-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
51 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# --- build stage | ||
FROM balenalib/%%BALENA_ARCH%%-ubuntu-python:3.9-build AS build | ||
FROM balenalib/%%BALENA_ARCH%%-ubuntu-python:3.10-build AS build | ||
|
||
LABEL [email protected] | ||
|
||
|
@@ -31,10 +31,12 @@ RUN install_packages \ | |
flex \ | ||
gawk \ | ||
gettext \ | ||
libcap-ng-dev \ | ||
libev-dev \ | ||
liblz4-dev \ | ||
liblzo2-dev \ | ||
libpam-dev \ | ||
libnl-genl-3-dev \ | ||
libpam0g-dev \ | ||
libssl-dev \ | ||
libtool \ | ||
libudns-dev \ | ||
|
@@ -69,7 +71,8 @@ RUN if [ "$BUILD_OPENSSL" = '1' ]; then \ | |
|
||
# https://stackoverflow.com/a/39006247/1559300 | ||
RUN if [ "$BUILD_OPENVPN" = '1' ]; then \ | ||
set -x; wget -q https://swupdate.openvpn.org/community/releases/openvpn-$BUILD_OPENVPN_VERSION.tar.gz \ | ||
set -x; wget --retry-on-host-error --retry-connrefused --waitretry=2 -q \ | ||
https://swupdate.openvpn.org/community/releases/openvpn-$BUILD_OPENVPN_VERSION.tar.gz \ | ||
&& tar -xvf openvpn-$BUILD_OPENVPN_VERSION.tar.gz && cd openvpn-$BUILD_OPENVPN_VERSION \ | ||
&& if [ "$BUILD_OPENSSL" = '1' ]; then CFLAGS='-I/usr/local/ssl/include -Wl,-rpath=/usr/local/ssl/lib -Wl,-rpath=/usr/local/ssl/lib64 -L/usr/local/ssl/lib -L/usr/local/ssl/lib64' ./configure; else ./configure; fi \ | ||
&& make -j $(nproc) && make check && make install \ | ||
|
@@ -85,15 +88,19 @@ RUN if [ "$BUILD_SNIPROXY" = '1' ]; then \ | |
&& make install; fi | ||
|
||
RUN if [ "$BUILD_BIRD" = '1' ]; then \ | ||
wget -q https://bird.network.cz/download/bird-$BUILD_BIRD_VERSION.tar.gz \ | ||
wget --retry-on-host-error --retry-connrefused --waitretry=2 -q \ | ||
https://bird.network.cz/download/bird-$BUILD_BIRD_VERSION.tar.gz \ | ||
&& tar -xvf bird-$BUILD_BIRD_VERSION.tar.gz && cd bird-$BUILD_BIRD_VERSION \ | ||
&& mkdir -p tools/ \ | ||
&& wget -qO tools/config.guess 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' \ | ||
&& wget -qO tools/config.sub 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' \ | ||
&& wget --retry-on-host-error --retry-connrefused --waitretry=2 -qO tools/config.guess \ | ||
'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' \ | ||
&& wget --retry-on-host-error --retry-connrefused --waitretry=2 -qO tools/config.sub \ | ||
'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' \ | ||
&& autoreconf && ./configure && make -j $(nproc) && make install; fi | ||
|
||
RUN if [ "$BUILD_WANPROXY" = '1' ]; then \ | ||
wget -q http://wanproxy.org/releases/wanproxy-$BUILD_WANPROXY_VERSION.tar.gz \ | ||
wget --retry-on-host-error --retry-connrefused --waitretry=2 -q \ | ||
http://wanproxy.org/releases/wanproxy-$BUILD_WANPROXY_VERSION.tar.gz \ | ||
&& tar zxf wanproxy-$BUILD_WANPROXY_VERSION.tar.gz \ | ||
&& cd wanproxy-$BUILD_WANPROXY_VERSION/programs/wanproxy \ | ||
&& make && cp wanproxy /usr/local/sbin; fi | ||
|
@@ -161,15 +168,18 @@ WORKDIR /opt | |
RUN set -a \ | ||
&& . /run/secrets/env \ | ||
&& mkdir -p /usr/share/GeoIP/ \ | ||
&& wget -q "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&license_key=$MAXMIND_LICENSE_KEY&suffix=tar.gz" -O - | gunzip -d - > /usr/share/GeoIP/GeoIP.dat \ | ||
&& wget -q "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=$MAXMIND_LICENSE_KEY&suffix=tar.gz" -O - | gunzip -d - > /usr/share/GeoIP/GeoLiteCity.dat \ | ||
&& wget -q "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-ASN&license_key=$MAXMIND_LICENSE_KEY&suffix=tar.gz" -O - | gunzip -d - > /usr/share/GeoIP/GeoIPASNum.dat | ||
&& wget --retry-on-host-error --retry-connrefused --waitretry=2 -q \ | ||
"https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&license_key=$MAXMIND_LICENSE_KEY&suffix=tar.gz" -O - | gunzip -d - > /usr/share/GeoIP/GeoIP.dat \ | ||
&& wget --retry-on-host-error --retry-connrefused --waitretry=2 -q \ | ||
"https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=$MAXMIND_LICENSE_KEY&suffix=tar.gz" -O - | gunzip -d - > /usr/share/GeoIP/GeoLiteCity.dat \ | ||
&& wget --retry-on-host-error --retry-connrefused --waitretry=2 -q \ | ||
"https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-ASN&license_key=$MAXMIND_LICENSE_KEY&suffix=tar.gz" -O - | gunzip -d - > /usr/share/GeoIP/GeoIPASNum.dat | ||
|
||
COPY systemd/* ./systemd/ | ||
|
||
|
||
# --- runtime | ||
FROM balenalib/%%BALENA_ARCH%%-ubuntu-python:3.9 | ||
FROM balenalib/%%BALENA_ARCH%%-ubuntu-python:3.10 | ||
|
||
LABEL [email protected] | ||
|
||
|
@@ -242,10 +252,12 @@ RUN install_packages \ | |
iw \ | ||
jq \ | ||
kmod \ | ||
libcap-ng0 \ | ||
libev4 \ | ||
libevent-2.1 \ | ||
liblz4-1 \ | ||
liblzo2-2 \ | ||
libnl-genl-3-200 \ | ||
libpcre3 \ | ||
libtool \ | ||
libudns0 \ | ||
|
@@ -278,22 +290,22 @@ RUN install_packages \ | |
RUN (groupadd bird || true) && (useradd -r -g bird bird || true) | ||
|
||
RUN systemctl set-default multi-user.target \ | ||
&& systemctl mask \ | ||
apt-daily-upgrade.timer \ | ||
apt-daily.timer \ | ||
dev-hugepages.mount \ | ||
dev-mqueue.mount \ | ||
display-manager.service \ | ||
getty.target \ | ||
[email protected] \ | ||
graphical.target \ | ||
sys-fs-fuse-connections.mount \ | ||
sys-kernel-config.mount \ | ||
sys-kernel-debug.mount \ | ||
systemd-logind.service \ | ||
systemd-remount-fs.service \ | ||
&& systemctl enable /etc/systemd/system/balena.service \ | ||
ssh.service \ | ||
&& systemctl mask \ | ||
apt-daily-upgrade.timer \ | ||
apt-daily.timer \ | ||
dev-hugepages.mount \ | ||
dev-mqueue.mount \ | ||
display-manager.service \ | ||
getty.target \ | ||
[email protected] \ | ||
graphical.target \ | ||
sys-fs-fuse-connections.mount \ | ||
sys-kernel-config.mount \ | ||
sys-kernel-debug.mount \ | ||
systemd-logind.service \ | ||
systemd-remount-fs.service \ | ||
&& systemctl enable /etc/systemd/system/balena.service \ | ||
ssh.service \ | ||
openntpd.service | ||
|
||
STOPSIGNAL SIGRTMIN+3 | ||
|
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