Add support for building ubuntu:20.04-based docker images + some automation
This commit is contained in:
parent
f7372fc393
commit
348a4b0865
9 changed files with 200 additions and 55 deletions
1
dockerfiles/Dockerfile.alpine
Symbolic link
1
dockerfiles/Dockerfile.alpine
Symbolic link
|
@ -0,0 +1 @@
|
|||
Dockerfile.alpine3.13
|
44
dockerfiles/Dockerfile.alpine3.13
Normal file
44
dockerfiles/Dockerfile.alpine3.13
Normal file
|
@ -0,0 +1,44 @@
|
|||
# THIS FILE IS AUTOGENERATED BY gen-dockerfiles.sh.
|
||||
# SEE zeronet-Dockerfile FOR THE SOURCE FILE.
|
||||
|
||||
FROM alpine:3.13
|
||||
|
||||
# Base settings
|
||||
ENV HOME /root
|
||||
|
||||
# Install packages
|
||||
|
||||
# Install packages
|
||||
|
||||
COPY install-dep-packages.sh /root/install-dep-packages.sh
|
||||
|
||||
RUN /root/install-dep-packages.sh install
|
||||
|
||||
COPY requirements.txt /root/requirements.txt
|
||||
|
||||
RUN pip3 install -r /root/requirements.txt \
|
||||
&& /root/install-dep-packages.sh remove-makedeps \
|
||||
&& echo "ControlPort 9051" >> /etc/tor/torrc \
|
||||
&& echo "CookieAuthentication 1" >> /etc/tor/torrc
|
||||
|
||||
RUN python3 -V \
|
||||
&& python3 -m pip list \
|
||||
&& tor --version \
|
||||
&& openssl version
|
||||
|
||||
# Add Zeronet source
|
||||
|
||||
COPY . /root
|
||||
VOLUME /root/data
|
||||
|
||||
# Control if Tor proxy is started
|
||||
ENV ENABLE_TOR false
|
||||
|
||||
WORKDIR /root
|
||||
|
||||
# Set upstart command
|
||||
CMD (! ${ENABLE_TOR} || tor&) && python3 zeronet.py --ui_ip 0.0.0.0 --fileserver_port 26552
|
||||
|
||||
# Expose ports
|
||||
EXPOSE 43110 26552
|
||||
|
1
dockerfiles/Dockerfile.ubuntu
Symbolic link
1
dockerfiles/Dockerfile.ubuntu
Symbolic link
|
@ -0,0 +1 @@
|
|||
Dockerfile.ubuntu20.04
|
44
dockerfiles/Dockerfile.ubuntu20.04
Normal file
44
dockerfiles/Dockerfile.ubuntu20.04
Normal file
|
@ -0,0 +1,44 @@
|
|||
# THIS FILE IS AUTOGENERATED BY gen-dockerfiles.sh.
|
||||
# SEE zeronet-Dockerfile FOR THE SOURCE FILE.
|
||||
|
||||
FROM ubuntu:20.04
|
||||
|
||||
# Base settings
|
||||
ENV HOME /root
|
||||
|
||||
# Install packages
|
||||
|
||||
# Install packages
|
||||
|
||||
COPY install-dep-packages.sh /root/install-dep-packages.sh
|
||||
|
||||
RUN /root/install-dep-packages.sh install
|
||||
|
||||
COPY requirements.txt /root/requirements.txt
|
||||
|
||||
RUN pip3 install -r /root/requirements.txt \
|
||||
&& /root/install-dep-packages.sh remove-makedeps \
|
||||
&& echo "ControlPort 9051" >> /etc/tor/torrc \
|
||||
&& echo "CookieAuthentication 1" >> /etc/tor/torrc
|
||||
|
||||
RUN python3 -V \
|
||||
&& python3 -m pip list \
|
||||
&& tor --version \
|
||||
&& openssl version
|
||||
|
||||
# Add Zeronet source
|
||||
|
||||
COPY . /root
|
||||
VOLUME /root/data
|
||||
|
||||
# Control if Tor proxy is started
|
||||
ENV ENABLE_TOR false
|
||||
|
||||
WORKDIR /root
|
||||
|
||||
# Set upstart command
|
||||
CMD (! ${ENABLE_TOR} || tor&) && python3 zeronet.py --ui_ip 0.0.0.0 --fileserver_port 26552
|
||||
|
||||
# Expose ports
|
||||
EXPOSE 43110 26552
|
||||
|
34
dockerfiles/gen-dockerfiles.sh
Executable file
34
dockerfiles/gen-dockerfiles.sh
Executable file
|
@ -0,0 +1,34 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
die() {
|
||||
echo "$@" > /dev/stderr
|
||||
exit 1
|
||||
}
|
||||
|
||||
for os in alpine:3.13 ubuntu:20.04 ; do
|
||||
prefix="`echo "$os" | sed -e 's/://'`"
|
||||
short_prefix="`echo "$os" | sed -e 's/:.*//'`"
|
||||
|
||||
zeronet="zeronet-Dockerfile"
|
||||
|
||||
dockerfile="Dockerfile.$prefix"
|
||||
dockerfile_short="Dockerfile.$short_prefix"
|
||||
|
||||
echo "GEN $dockerfile"
|
||||
|
||||
if ! test -f "$zeronet" ; then
|
||||
die "No such file: $zeronet"
|
||||
fi
|
||||
|
||||
echo "\
|
||||
# THIS FILE IS AUTOGENERATED BY gen-dockerfiles.sh.
|
||||
# SEE $zeronet FOR THE SOURCE FILE.
|
||||
|
||||
FROM $os
|
||||
|
||||
`cat "$zeronet"`
|
||||
" > "$dockerfile.tmp" && mv "$dockerfile.tmp" "$dockerfile" && ln -s -f "$dockerfile" "$dockerfile_short"
|
||||
done
|
||||
|
36
dockerfiles/zeronet-Dockerfile
Normal file
36
dockerfiles/zeronet-Dockerfile
Normal file
|
@ -0,0 +1,36 @@
|
|||
# Base settings
|
||||
ENV HOME /root
|
||||
|
||||
# Install packages
|
||||
|
||||
COPY install-dep-packages.sh /root/install-dep-packages.sh
|
||||
|
||||
RUN /root/install-dep-packages.sh install
|
||||
|
||||
COPY requirements.txt /root/requirements.txt
|
||||
|
||||
RUN pip3 install -r /root/requirements.txt \
|
||||
&& /root/install-dep-packages.sh remove-makedeps \
|
||||
&& echo "ControlPort 9051" >> /etc/tor/torrc \
|
||||
&& echo "CookieAuthentication 1" >> /etc/tor/torrc
|
||||
|
||||
RUN python3 -V \
|
||||
&& python3 -m pip list \
|
||||
&& tor --version \
|
||||
&& openssl version
|
||||
|
||||
# Add Zeronet source
|
||||
|
||||
COPY . /root
|
||||
VOLUME /root/data
|
||||
|
||||
# Control if Tor proxy is started
|
||||
ENV ENABLE_TOR false
|
||||
|
||||
WORKDIR /root
|
||||
|
||||
# Set upstart command
|
||||
CMD (! ${ENABLE_TOR} || tor&) && python3 zeronet.py --ui_ip 0.0.0.0 --fileserver_port 26552
|
||||
|
||||
# Expose ports
|
||||
EXPOSE 43110 26552
|
Loading…
Add table
Add a link
Reference in a new issue