-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from siomiz/multibase
handle multiple base images, alleviates #42
- Loading branch information
Showing
4 changed files
with
122 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
FROM alpine:3.7 as prep | ||
|
||
LABEL maintainer="Tomohisa Kusano <siomiz@gmail.com>" \ | ||
contributors="Ian Neubert <github.com/ianneub>; Ky-Anh Huynh <github.com/icy>; Max Kuchin <mkuchin@gmail.com>; maltalex <github.com/maltalex>" | ||
|
||
ENV BUILD_VERSION=4.25-9656-rtm \ | ||
SHA256_SUM=c5a1791d69dc6d1c53fb574a3ce709707338520be797acbeac0a631c96c68330 | ||
|
||
RUN wget https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/archive/v${BUILD_VERSION}.tar.gz \ | ||
&& echo "${SHA256_SUM} v${BUILD_VERSION}.tar.gz" | sha256sum -c \ | ||
&& mkdir -p /usr/local/src \ | ||
&& tar -x -C /usr/local/src/ -f v${BUILD_VERSION}.tar.gz \ | ||
&& rm v${BUILD_VERSION}.tar.gz | ||
|
||
FROM debian:9-slim | ||
|
||
COPY --from=prep /usr/local/src /usr/local/src | ||
|
||
COPY copyables / | ||
|
||
RUN /bin/bash /build-debian.sh \ | ||
&& /bin/rm /build-*.sh | ||
|
||
RUN chmod +x /entrypoint.sh /gencert.sh \ | ||
&& rm -rf /opt && ln -s /usr/vpnserver /opt \ | ||
&& find /usr/bin/vpn* -type f ! -name vpnserver \ | ||
-exec bash -c 'ln -s {} /opt/$(basename {})' \; | ||
|
||
WORKDIR /usr/vpnserver/ | ||
|
||
VOLUME ["/usr/vpnserver/server_log/"] | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
EXPOSE 500/udp 4500/udp 1701/tcp 1194/udp 5555/tcp | ||
|
||
CMD ["/usr/bin/vpnserver", "execsvc"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
echo "clean_requirements_on_remove=1" >> /etc/yum.conf | ||
|
||
yum -y update \ | ||
&& yum -y install unzip \ | ||
&& yum -y groupinstall "Development Tools" \ | ||
&& yum -y install readline-devel ncurses-devel openssl-devel iptables sysvinit-tools | ||
|
||
# Build SoftEtherVPN | ||
|
||
cd /usr/local/src/SoftEtherVPN_Stable-* | ||
|
||
cp src/makefiles/linux_64bit.mak Makefile | ||
|
||
make | ||
|
||
make install | ||
|
||
cd / | ||
|
||
rm -rf /usr/local/src/SoftEtherVPN_Stable-* | ||
|
||
# Clean-up | ||
# Keep iptables (for vpnserver) & sysvinit-tools (for pidof) | ||
|
||
yum -y remove readline-devel ncurses-devel openssl-devel \ | ||
&& yum -y groupremove "Development Tools" \ | ||
&& yum clean all | ||
|
||
rm -rf /var/log/* /var/cache/yum/* /var/lib/yum/* | ||
|
||
exit 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
apt-get update | ||
|
||
apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
libreadline7 \ | ||
libreadline-dev \ | ||
libssl1.1 \ | ||
libssl-dev \ | ||
libncurses5 \ | ||
libncurses5-dev \ | ||
zlib1g \ | ||
zlib1g-dev \ | ||
iptables \ | ||
unzip \ | ||
|
||
cd /usr/local/src/SoftEtherVPN_Stable-* | ||
|
||
./configure | ||
|
||
make | ||
|
||
make install | ||
|
||
cd / | ||
|
||
rm -rf /usr/local/src/SoftEtherVPN_Stable-* | ||
|
||
apt-get purge -y \ | ||
build-essential \ | ||
libreadline-dev \ | ||
libssl-dev \ | ||
lib32ncurses5-dev \ | ||
zlib1g-dev | ||
|
||
apt-get -y autoremove | ||
|
||
rm -rf /var/lib/apt/lists/* |