Skip to content

Commit

Permalink
Fix: Fix testing openvpn in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
leojonathanoh committed Sep 27, 2023
1 parent 77bae70 commit df189f8
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 26 deletions.
5 changes: 3 additions & 2 deletions generate/templates/Dockerfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
FROM $( $VARIANT['_metadata']['distro'] ):$( $VARIANT['_metadata']['distro_version'] )
RUN set -eux; \
apk add --no-cache $( $VARIANT['_metadata']['package'] )$( if ([version]$VARIANT['_metadata']['distro_version'] -le [version]'3.6') { '>=' } else { '~=' } )$( $VARIANT['_metadata']['package_version'] ) iptables \
openvpn --version
apk add --no-cache $( $VARIANT['_metadata']['package'] )$( if ([version]$VARIANT['_metadata']['distro_version'] -le [version]'3.6') { '>=' } else { '~=' } )$( $VARIANT['_metadata']['package_version'] ) iptables; \
# Workaround openvpn --version exiting with non-zero exit code on openvpn <= 2.4.x
openvpn --version | grep -A100 -B100 $( $VARIANT['_metadata']['package_version'] )
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
Expand Down
5 changes: 3 additions & 2 deletions variants/2.3.18-alpine-3.3/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM alpine:3.3

RUN set -eux; \
apk add --no-cache openvpn>=2.3.18 iptables \
openvpn --version
apk add --no-cache openvpn>=2.3.18 iptables; \
# Workaround openvpn --version exiting with non-zero exit code on openvpn <= 2.4.x
openvpn --version | grep -A100 -B100 2.3.18

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
Expand Down
5 changes: 3 additions & 2 deletions variants/2.3.18-alpine-3.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM alpine:3.4

RUN set -eux; \
apk add --no-cache openvpn>=2.3.18 iptables \
openvpn --version
apk add --no-cache openvpn>=2.3.18 iptables; \
# Workaround openvpn --version exiting with non-zero exit code on openvpn <= 2.4.x
openvpn --version | grep -A100 -B100 2.3.18

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
Expand Down
5 changes: 3 additions & 2 deletions variants/2.3.18-alpine-3.5/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM alpine:3.5

RUN set -eux; \
apk add --no-cache openvpn>=2.3.18 iptables \
openvpn --version
apk add --no-cache openvpn>=2.3.18 iptables; \
# Workaround openvpn --version exiting with non-zero exit code on openvpn <= 2.4.x
openvpn --version | grep -A100 -B100 2.3.18

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
Expand Down
5 changes: 3 additions & 2 deletions variants/2.4.11-alpine-3.10/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM alpine:3.10

RUN set -eux; \
apk add --no-cache openvpn~=2.4.11 iptables \
openvpn --version
apk add --no-cache openvpn~=2.4.11 iptables; \
# Workaround openvpn --version exiting with non-zero exit code on openvpn <= 2.4.x
openvpn --version | grep -A100 -B100 2.4.11

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
Expand Down
5 changes: 3 additions & 2 deletions variants/2.4.11-alpine-3.11/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM alpine:3.11

RUN set -eux; \
apk add --no-cache openvpn~=2.4.11 iptables \
openvpn --version
apk add --no-cache openvpn~=2.4.11 iptables; \
# Workaround openvpn --version exiting with non-zero exit code on openvpn <= 2.4.x
openvpn --version | grep -A100 -B100 2.4.11

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
Expand Down
5 changes: 3 additions & 2 deletions variants/2.4.12-alpine-3.12/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM alpine:3.12

RUN set -eux; \
apk add --no-cache openvpn~=2.4.12 iptables \
openvpn --version
apk add --no-cache openvpn~=2.4.12 iptables; \
# Workaround openvpn --version exiting with non-zero exit code on openvpn <= 2.4.x
openvpn --version | grep -A100 -B100 2.4.12

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
Expand Down
5 changes: 3 additions & 2 deletions variants/2.4.4-alpine-3.6/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM alpine:3.6

RUN set -eux; \
apk add --no-cache openvpn>=2.4.4 iptables \
openvpn --version
apk add --no-cache openvpn>=2.4.4 iptables; \
# Workaround openvpn --version exiting with non-zero exit code on openvpn <= 2.4.x
openvpn --version | grep -A100 -B100 2.4.4

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
Expand Down
5 changes: 3 additions & 2 deletions variants/2.4.4-alpine-3.7/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM alpine:3.7

RUN set -eux; \
apk add --no-cache openvpn~=2.4.4 iptables \
openvpn --version
apk add --no-cache openvpn~=2.4.4 iptables; \
# Workaround openvpn --version exiting with non-zero exit code on openvpn <= 2.4.x
openvpn --version | grep -A100 -B100 2.4.4

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
Expand Down
5 changes: 3 additions & 2 deletions variants/2.4.6-alpine-3.8/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM alpine:3.8

RUN set -eux; \
apk add --no-cache openvpn~=2.4.6 iptables \
openvpn --version
apk add --no-cache openvpn~=2.4.6 iptables; \
# Workaround openvpn --version exiting with non-zero exit code on openvpn <= 2.4.x
openvpn --version | grep -A100 -B100 2.4.6

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
Expand Down
5 changes: 3 additions & 2 deletions variants/2.4.6-alpine-3.9/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM alpine:3.9

RUN set -eux; \
apk add --no-cache openvpn~=2.4.6 iptables \
openvpn --version
apk add --no-cache openvpn~=2.4.6 iptables; \
# Workaround openvpn --version exiting with non-zero exit code on openvpn <= 2.4.x
openvpn --version | grep -A100 -B100 2.4.6

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
Expand Down
5 changes: 3 additions & 2 deletions variants/2.5.8-alpine-3.17/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM alpine:3.17

RUN set -eux; \
apk add --no-cache openvpn~=2.5.8 iptables \
openvpn --version
apk add --no-cache openvpn~=2.5.8 iptables; \
# Workaround openvpn --version exiting with non-zero exit code on openvpn <= 2.4.x
openvpn --version | grep -A100 -B100 2.5.8

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
Expand Down
5 changes: 3 additions & 2 deletions variants/2.6.5-alpine-3.18/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM alpine:3.18

RUN set -eux; \
apk add --no-cache openvpn~=2.6.5 iptables \
openvpn --version
apk add --no-cache openvpn~=2.6.5 iptables; \
# Workaround openvpn --version exiting with non-zero exit code on openvpn <= 2.4.x
openvpn --version | grep -A100 -B100 2.6.5

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
Expand Down

0 comments on commit df189f8

Please sign in to comment.