-
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.
Merge pull request #1 from xtrime-ru/dev
Fix unattended upgrade in container
- Loading branch information
Showing
4 changed files
with
26 additions
and
6 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM alpine:latest as builder | ||
# Docker cant unpack remote archives via ADD command :( | ||
# Lets use multistage build to download and unpack remote archive. | ||
RUN wget https://antizapret.prostovpn.org/container-images/az-vpn/rootfs.tar.xz \ | ||
&& mkdir /rootfs-dir \ | ||
&& tar -xf /rootfs.tar.xz -C /rootfs-dir/ | ||
|
||
FROM scratch | ||
COPY --from=builder /rootfs-dir / | ||
RUN wget https://secure.nic.cz/files/knot-resolver/knot-resolver-release.deb --no-check-certificate \ | ||
&& dpkg --force-confnew -i knot-resolver-release.deb \ | ||
&& rm knot-resolver-release.deb \ | ||
&& chmod 1777 /tmp \ | ||
&& apt update -y \ | ||
&& apt upgrade -y -o Dpkg::Options::="--force-confold" \ | ||
&& apt autoremove -y && apt clean | ||
|
||
COPY ./init.sh / | ||
ENTRYPOINT ["/init.sh"] |
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
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,12 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [[ ! -f ./easyrsa3/easyrsa ]] | ||
if [[ ! -f /root/easy-rsa-ipsec/easyrsa3/easyrsa ]] | ||
# We need to easyrsa3/pki folder to be persistent. | ||
# But we cant just symlink it, because easyrsa will try to remove it and crash during key regeneration. | ||
# So we replace existing folder with link from host. | ||
then | ||
curl -L https://github.com/OpenVPN/easy-rsa/releases/download/v3.1.0/EasyRSA-3.1.0.tgz | tar -xz | ||
mv EasyRSA-3.1.0 easyrsa3 | ||
mv EasyRSA-3.1.0/* /root/easy-rsa-ipsec/easyrsa3 | ||
rm -rf EasyRSA-3.1.0/ | ||
fi | ||
|
||
docker import https://antizapret.prostovpn.org/container-images/az-vpn/rootfs.tar.xz xtrime/antizapret-vpn:latest | ||
/root/easy-rsa-ipsec/generate.sh \ | ||
&& exec /usr/sbin/init |