Skip to content

Commit

Permalink
Merge pull request #28 from theohbrothers/enhancement/add-validation-…
Browse files Browse the repository at this point in the history
…for-sops

Enhancement: Add validation for `sops`
  • Loading branch information
leojonathanoh authored Mar 11, 2023
2 parents 91610b5 + 403fad6 commit 00a8a7e
Show file tree
Hide file tree
Showing 15 changed files with 88 additions and 24 deletions.
20 changes: 14 additions & 6 deletions generate/templates/Dockerfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,31 @@ RUN apk add --no-cache libvirt-client

if ( $VARIANT['_metadata']['components'] -contains 'sops' ) {
if ( $VARIANT['_metadata']['distro'] -eq 'alpine' -and $VARIANT['_metadata']['distro_version'] -in @('3.6', '3.5', '3.4', '3.3') ) {
@"
@"
# Fix generic certification validation errors in alpine 3.5: https://github.com/docker-library/official-images/issues/2773#issuecomment-350431934
RUN apk add --no-cache ca-certificates
# Fix wget not working in alpine:3.6 and below. https://github.com/gliderlabs/docker-alpine/issues/423
# RUN apk add --no-cache libressl
# Fix wget error 'wget: SSL/TLS certificate is not being validated!' in alpine:3.5, use curl instead: https://github.com/docker-library/official-images/issues/2773
RUN apk add --no-cache curl \
&& curl -sL https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops \
&& apk del curl
RUN set -eux; \
apk add --no-cache curl; \
curl -sSL https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops; \
chmod +x /usr/local/bin/sops; \
sha256sum /usr/local/bin/sops | grep '^185348fd77fc160d5bdf3cd20ecbc796163504fd3df196d7cb29000773657b74 '; \
sops --version; \
apk del curl
"@
}else {
@"
RUN wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops
@"
RUN set -eux; \
wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops; \
chmod +x /usr/local/bin/sops; \
sha256sum /usr/local/bin/sops | grep '^185348fd77fc160d5bdf3cd20ecbc796163504fd3df196d7cb29000773657b74 '; \
sops --version
"@
Expand Down
6 changes: 5 additions & 1 deletion variants/v0.11.0-jq-sops-ssh-alpine-3.7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ RUN apk add --no-cache terraform=0.11.0-r0

RUN apk add --no-cache jq

RUN wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops
RUN set -eux; \
wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops; \
chmod +x /usr/local/bin/sops; \
sha256sum /usr/local/bin/sops | grep '^185348fd77fc160d5bdf3cd20ecbc796163504fd3df196d7cb29000773657b74 '; \
sops --version

RUN apk add --no-cache gnupg

Expand Down
6 changes: 5 additions & 1 deletion variants/v0.11.7-jq-sops-ssh-alpine-3.8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ RUN apk add --no-cache terraform=0.11.7-r0

RUN apk add --no-cache jq

RUN wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops
RUN set -eux; \
wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops; \
chmod +x /usr/local/bin/sops; \
sha256sum /usr/local/bin/sops | grep '^185348fd77fc160d5bdf3cd20ecbc796163504fd3df196d7cb29000773657b74 '; \
sops --version

RUN apk add --no-cache gnupg

Expand Down
6 changes: 5 additions & 1 deletion variants/v0.11.8-jq-sops-ssh-alpine-3.9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ RUN apk add --no-cache terraform=0.11.8-r0

RUN apk add --no-cache jq

RUN wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops
RUN set -eux; \
wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops; \
chmod +x /usr/local/bin/sops; \
sha256sum /usr/local/bin/sops | grep '^185348fd77fc160d5bdf3cd20ecbc796163504fd3df196d7cb29000773657b74 '; \
sops --version

RUN apk add --no-cache gnupg

Expand Down
6 changes: 5 additions & 1 deletion variants/v0.12.17-jq-sops-ssh-alpine-3.11/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ RUN apk add --no-cache terraform=0.12.17-r1

RUN apk add --no-cache jq

RUN wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops
RUN set -eux; \
wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops; \
chmod +x /usr/local/bin/sops; \
sha256sum /usr/local/bin/sops | grep '^185348fd77fc160d5bdf3cd20ecbc796163504fd3df196d7cb29000773657b74 '; \
sops --version

RUN apk add --no-cache gnupg

Expand Down
6 changes: 5 additions & 1 deletion variants/v0.12.25-jq-sops-ssh-alpine-3.12/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ RUN apk add --no-cache terraform=0.12.25-r0

RUN apk add --no-cache jq

RUN wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops
RUN set -eux; \
wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops; \
chmod +x /usr/local/bin/sops; \
sha256sum /usr/local/bin/sops | grep '^185348fd77fc160d5bdf3cd20ecbc796163504fd3df196d7cb29000773657b74 '; \
sops --version

RUN apk add --no-cache gnupg

Expand Down
6 changes: 5 additions & 1 deletion variants/v0.12.6-jq-sops-ssh-alpine-3.10/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ RUN apk add --no-cache terraform=0.12.6-r0

RUN apk add --no-cache jq

RUN wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops
RUN set -eux; \
wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops; \
chmod +x /usr/local/bin/sops; \
sha256sum /usr/local/bin/sops | grep '^185348fd77fc160d5bdf3cd20ecbc796163504fd3df196d7cb29000773657b74 '; \
sops --version

RUN apk add --no-cache gnupg

Expand Down
6 changes: 5 additions & 1 deletion variants/v0.14.4-jq-sops-ssh-alpine-3.13/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ RUN apk add --no-cache terraform=0.14.4-r0

RUN apk add --no-cache jq

RUN wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops
RUN set -eux; \
wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops; \
chmod +x /usr/local/bin/sops; \
sha256sum /usr/local/bin/sops | grep '^185348fd77fc160d5bdf3cd20ecbc796163504fd3df196d7cb29000773657b74 '; \
sops --version

RUN apk add --no-cache gnupg

Expand Down
6 changes: 5 additions & 1 deletion variants/v0.14.9-jq-sops-ssh-alpine-3.14/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ RUN apk add --no-cache terraform=0.14.9-r4

RUN apk add --no-cache jq

RUN wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops
RUN set -eux; \
wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops; \
chmod +x /usr/local/bin/sops; \
sha256sum /usr/local/bin/sops | grep '^185348fd77fc160d5bdf3cd20ecbc796163504fd3df196d7cb29000773657b74 '; \
sops --version

RUN apk add --no-cache gnupg

Expand Down
10 changes: 7 additions & 3 deletions variants/v0.8.1-jq-sops-ssh-alpine-3.5/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ RUN apk add --no-cache ca-certificates
# RUN apk add --no-cache libressl

# Fix wget error 'wget: SSL/TLS certificate is not being validated!' in alpine:3.5, use curl instead: https://github.com/docker-library/official-images/issues/2773
RUN apk add --no-cache curl \
&& curl -sL https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops \
&& apk del curl
RUN set -eux; \
apk add --no-cache curl; \
curl -sSL https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops; \
chmod +x /usr/local/bin/sops; \
sha256sum /usr/local/bin/sops | grep '^185348fd77fc160d5bdf3cd20ecbc796163504fd3df196d7cb29000773657b74 '; \
sops --version; \
apk del curl

RUN apk add --no-cache gnupg

Expand Down
10 changes: 7 additions & 3 deletions variants/v0.9.5-jq-sops-ssh-alpine-3.6/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ RUN apk add --no-cache ca-certificates
# RUN apk add --no-cache libressl

# Fix wget error 'wget: SSL/TLS certificate is not being validated!' in alpine:3.5, use curl instead: https://github.com/docker-library/official-images/issues/2773
RUN apk add --no-cache curl \
&& curl -sL https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops \
&& apk del curl
RUN set -eux; \
apk add --no-cache curl; \
curl -sSL https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops; \
chmod +x /usr/local/bin/sops; \
sha256sum /usr/local/bin/sops | grep '^185348fd77fc160d5bdf3cd20ecbc796163504fd3df196d7cb29000773657b74 '; \
sops --version; \
apk del curl

RUN apk add --no-cache gnupg

Expand Down
6 changes: 5 additions & 1 deletion variants/v1.0.11-jq-sops-ssh-alpine-3.15/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ RUN apk add --no-cache terraform=1.0.11-r2

RUN apk add --no-cache jq

RUN wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops
RUN set -eux; \
wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops; \
chmod +x /usr/local/bin/sops; \
sha256sum /usr/local/bin/sops | grep '^185348fd77fc160d5bdf3cd20ecbc796163504fd3df196d7cb29000773657b74 '; \
sops --version

RUN apk add --no-cache gnupg

Expand Down
6 changes: 5 additions & 1 deletion variants/v1.2.0-jq-sops-ssh-alpine-3.16/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ RUN apk add --no-cache terraform=1.2.0-r4

RUN apk add --no-cache jq

RUN wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops
RUN set -eux; \
wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops; \
chmod +x /usr/local/bin/sops; \
sha256sum /usr/local/bin/sops | grep '^185348fd77fc160d5bdf3cd20ecbc796163504fd3df196d7cb29000773657b74 '; \
sops --version

RUN apk add --no-cache gnupg

Expand Down
6 changes: 5 additions & 1 deletion variants/v1.3.4-jq-libvirt-sops-ssh-alpine-3.17/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ RUN apk add --no-cache jq

RUN apk add --no-cache libvirt-client

RUN wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops
RUN set -eux; \
wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops; \
chmod +x /usr/local/bin/sops; \
sha256sum /usr/local/bin/sops | grep '^185348fd77fc160d5bdf3cd20ecbc796163504fd3df196d7cb29000773657b74 '; \
sops --version

RUN apk add --no-cache gnupg

Expand Down
6 changes: 5 additions & 1 deletion variants/v1.3.4-jq-sops-ssh-alpine-3.17/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ RUN apk add --no-cache terraform=1.3.4-r2

RUN apk add --no-cache jq

RUN wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops
RUN set -eux; \
wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops; \
chmod +x /usr/local/bin/sops; \
sha256sum /usr/local/bin/sops | grep '^185348fd77fc160d5bdf3cd20ecbc796163504fd3df196d7cb29000773657b74 '; \
sops --version

RUN apk add --no-cache gnupg

Expand Down

0 comments on commit 00a8a7e

Please sign in to comment.