Skip to content

Commit

Permalink
Merge pull request #24 from leojonathanoh/enhancement/verify-kubectl-…
Browse files Browse the repository at this point in the history
…checksum

Enhancement: Verify kubectl checksum
  • Loading branch information
leojonathanoh authored Nov 19, 2021
2 parents 653fa36 + bda9f0a commit c55bd3a
Show file tree
Hide file tree
Showing 19 changed files with 114 additions and 19 deletions.
7 changes: 6 additions & 1 deletion generate/templates/Dockerfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ ARG BUILDPLATFORM
RUN echo "I am running on `$BUILDPLATFORM, building for `$TARGETPLATFORM"
# When `$TARGETPLATFORM is linux/arm/v7, strip out the '/v6' or '/v7' from it
RUN wget -qO- https://storage.googleapis.com/kubernetes-release/release/$( $VARIANT['_metadata']['package_version'] )/bin/`$( echo `$TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl > /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl
RUN BIN_URL=https://storage.googleapis.com/kubernetes-release/release/$( $VARIANT['_metadata']['package_version'] )/bin/`$( echo `$TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl \
&& SHA512=`$( wget -qO- "`$BIN_URL.sha512" ) \
&& [ -n "`$SHA512" ] \
&& wget -qO- "`$BIN_URL" > /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl \
&& sha512sum /usr/local/bin/kubectl | grep "`$SHA512"
"@
Expand Down
7 changes: 6 additions & 1 deletion variants/v1.14.10-alpine-3.8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# When $TARGETPLATFORM is linux/arm/v7, strip out the '/v6' or '/v7' from it
RUN wget -qO- https://storage.googleapis.com/kubernetes-release/release/v1.14.10/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl > /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl
RUN BIN_URL=https://storage.googleapis.com/kubernetes-release/release/v1.14.10/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl \
&& SHA512=$( wget -qO- "$BIN_URL.sha512" ) \
&& [ -n "$SHA512" ] \
&& wget -qO- "$BIN_URL" > /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl \
&& sha512sum /usr/local/bin/kubectl | grep "$SHA512"

CMD [ "/usr/local/bin/kubectl" ]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# When $TARGETPLATFORM is linux/arm/v7, strip out the '/v6' or '/v7' from it
RUN wget -qO- https://storage.googleapis.com/kubernetes-release/release/v1.14.10/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl > /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl
RUN BIN_URL=https://storage.googleapis.com/kubernetes-release/release/v1.14.10/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl \
&& SHA512=$( wget -qO- "$BIN_URL.sha512" ) \
&& [ -n "$SHA512" ] \
&& wget -qO- "$BIN_URL" > /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl \
&& sha512sum /usr/local/bin/kubectl | grep "$SHA512"

# From: https://github.com/nginxinc/docker-nginx/blob/1.17.0/stable/alpine/Dockerfile
# Bring in gettext so we can get `envsubst`, then throw
Expand Down
7 changes: 6 additions & 1 deletion variants/v1.15.12-alpine-3.8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# When $TARGETPLATFORM is linux/arm/v7, strip out the '/v6' or '/v7' from it
RUN wget -qO- https://storage.googleapis.com/kubernetes-release/release/v1.15.12/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl > /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl
RUN BIN_URL=https://storage.googleapis.com/kubernetes-release/release/v1.15.12/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl \
&& SHA512=$( wget -qO- "$BIN_URL.sha512" ) \
&& [ -n "$SHA512" ] \
&& wget -qO- "$BIN_URL" > /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl \
&& sha512sum /usr/local/bin/kubectl | grep "$SHA512"

CMD [ "/usr/local/bin/kubectl" ]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# When $TARGETPLATFORM is linux/arm/v7, strip out the '/v6' or '/v7' from it
RUN wget -qO- https://storage.googleapis.com/kubernetes-release/release/v1.15.12/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl > /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl
RUN BIN_URL=https://storage.googleapis.com/kubernetes-release/release/v1.15.12/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl \
&& SHA512=$( wget -qO- "$BIN_URL.sha512" ) \
&& [ -n "$SHA512" ] \
&& wget -qO- "$BIN_URL" > /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl \
&& sha512sum /usr/local/bin/kubectl | grep "$SHA512"

# From: https://github.com/nginxinc/docker-nginx/blob/1.17.0/stable/alpine/Dockerfile
# Bring in gettext so we can get `envsubst`, then throw
Expand Down
7 changes: 6 additions & 1 deletion variants/v1.16.15-alpine-3.8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# When $TARGETPLATFORM is linux/arm/v7, strip out the '/v6' or '/v7' from it
RUN wget -qO- https://storage.googleapis.com/kubernetes-release/release/v1.16.15/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl > /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl
RUN BIN_URL=https://storage.googleapis.com/kubernetes-release/release/v1.16.15/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl \
&& SHA512=$( wget -qO- "$BIN_URL.sha512" ) \
&& [ -n "$SHA512" ] \
&& wget -qO- "$BIN_URL" > /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl \
&& sha512sum /usr/local/bin/kubectl | grep "$SHA512"

CMD [ "/usr/local/bin/kubectl" ]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# When $TARGETPLATFORM is linux/arm/v7, strip out the '/v6' or '/v7' from it
RUN wget -qO- https://storage.googleapis.com/kubernetes-release/release/v1.16.15/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl > /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl
RUN BIN_URL=https://storage.googleapis.com/kubernetes-release/release/v1.16.15/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl \
&& SHA512=$( wget -qO- "$BIN_URL.sha512" ) \
&& [ -n "$SHA512" ] \
&& wget -qO- "$BIN_URL" > /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl \
&& sha512sum /usr/local/bin/kubectl | grep "$SHA512"

# From: https://github.com/nginxinc/docker-nginx/blob/1.17.0/stable/alpine/Dockerfile
# Bring in gettext so we can get `envsubst`, then throw
Expand Down
7 changes: 6 additions & 1 deletion variants/v1.17.17-alpine-3.8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# When $TARGETPLATFORM is linux/arm/v7, strip out the '/v6' or '/v7' from it
RUN wget -qO- https://storage.googleapis.com/kubernetes-release/release/v1.17.17/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl > /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl
RUN BIN_URL=https://storage.googleapis.com/kubernetes-release/release/v1.17.17/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl \
&& SHA512=$( wget -qO- "$BIN_URL.sha512" ) \
&& [ -n "$SHA512" ] \
&& wget -qO- "$BIN_URL" > /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl \
&& sha512sum /usr/local/bin/kubectl | grep "$SHA512"

CMD [ "/usr/local/bin/kubectl" ]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# When $TARGETPLATFORM is linux/arm/v7, strip out the '/v6' or '/v7' from it
RUN wget -qO- https://storage.googleapis.com/kubernetes-release/release/v1.17.17/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl > /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl
RUN BIN_URL=https://storage.googleapis.com/kubernetes-release/release/v1.17.17/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl \
&& SHA512=$( wget -qO- "$BIN_URL.sha512" ) \
&& [ -n "$SHA512" ] \
&& wget -qO- "$BIN_URL" > /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl \
&& sha512sum /usr/local/bin/kubectl | grep "$SHA512"

# From: https://github.com/nginxinc/docker-nginx/blob/1.17.0/stable/alpine/Dockerfile
# Bring in gettext so we can get `envsubst`, then throw
Expand Down
7 changes: 6 additions & 1 deletion variants/v1.18.15-alpine-3.8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# When $TARGETPLATFORM is linux/arm/v7, strip out the '/v6' or '/v7' from it
RUN wget -qO- https://storage.googleapis.com/kubernetes-release/release/v1.18.15/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl > /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl
RUN BIN_URL=https://storage.googleapis.com/kubernetes-release/release/v1.18.15/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl \
&& SHA512=$( wget -qO- "$BIN_URL.sha512" ) \
&& [ -n "$SHA512" ] \
&& wget -qO- "$BIN_URL" > /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl \
&& sha512sum /usr/local/bin/kubectl | grep "$SHA512"

CMD [ "/usr/local/bin/kubectl" ]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# When $TARGETPLATFORM is linux/arm/v7, strip out the '/v6' or '/v7' from it
RUN wget -qO- https://storage.googleapis.com/kubernetes-release/release/v1.18.15/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl > /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl
RUN BIN_URL=https://storage.googleapis.com/kubernetes-release/release/v1.18.15/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl \
&& SHA512=$( wget -qO- "$BIN_URL.sha512" ) \
&& [ -n "$SHA512" ] \
&& wget -qO- "$BIN_URL" > /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl \
&& sha512sum /usr/local/bin/kubectl | grep "$SHA512"

# From: https://github.com/nginxinc/docker-nginx/blob/1.17.0/stable/alpine/Dockerfile
# Bring in gettext so we can get `envsubst`, then throw
Expand Down
7 changes: 6 additions & 1 deletion variants/v1.19.7-alpine-3.8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# When $TARGETPLATFORM is linux/arm/v7, strip out the '/v6' or '/v7' from it
RUN wget -qO- https://storage.googleapis.com/kubernetes-release/release/v1.19.7/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl > /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl
RUN BIN_URL=https://storage.googleapis.com/kubernetes-release/release/v1.19.7/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl \
&& SHA512=$( wget -qO- "$BIN_URL.sha512" ) \
&& [ -n "$SHA512" ] \
&& wget -qO- "$BIN_URL" > /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl \
&& sha512sum /usr/local/bin/kubectl | grep "$SHA512"

CMD [ "/usr/local/bin/kubectl" ]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# When $TARGETPLATFORM is linux/arm/v7, strip out the '/v6' or '/v7' from it
RUN wget -qO- https://storage.googleapis.com/kubernetes-release/release/v1.19.7/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl > /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl
RUN BIN_URL=https://storage.googleapis.com/kubernetes-release/release/v1.19.7/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl \
&& SHA512=$( wget -qO- "$BIN_URL.sha512" ) \
&& [ -n "$SHA512" ] \
&& wget -qO- "$BIN_URL" > /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl \
&& sha512sum /usr/local/bin/kubectl | grep "$SHA512"

# From: https://github.com/nginxinc/docker-nginx/blob/1.17.0/stable/alpine/Dockerfile
# Bring in gettext so we can get `envsubst`, then throw
Expand Down
7 changes: 6 additions & 1 deletion variants/v1.20.4-alpine-3.8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# When $TARGETPLATFORM is linux/arm/v7, strip out the '/v6' or '/v7' from it
RUN wget -qO- https://storage.googleapis.com/kubernetes-release/release/v1.20.4/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl > /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl
RUN BIN_URL=https://storage.googleapis.com/kubernetes-release/release/v1.20.4/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl \
&& SHA512=$( wget -qO- "$BIN_URL.sha512" ) \
&& [ -n "$SHA512" ] \
&& wget -qO- "$BIN_URL" > /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl \
&& sha512sum /usr/local/bin/kubectl | grep "$SHA512"

CMD [ "/usr/local/bin/kubectl" ]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# When $TARGETPLATFORM is linux/arm/v7, strip out the '/v6' or '/v7' from it
RUN wget -qO- https://storage.googleapis.com/kubernetes-release/release/v1.20.4/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl > /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl
RUN BIN_URL=https://storage.googleapis.com/kubernetes-release/release/v1.20.4/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl \
&& SHA512=$( wget -qO- "$BIN_URL.sha512" ) \
&& [ -n "$SHA512" ] \
&& wget -qO- "$BIN_URL" > /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl \
&& sha512sum /usr/local/bin/kubectl | grep "$SHA512"

# From: https://github.com/nginxinc/docker-nginx/blob/1.17.0/stable/alpine/Dockerfile
# Bring in gettext so we can get `envsubst`, then throw
Expand Down
7 changes: 6 additions & 1 deletion variants/v1.21.0-alpine-3.8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# When $TARGETPLATFORM is linux/arm/v7, strip out the '/v6' or '/v7' from it
RUN wget -qO- https://storage.googleapis.com/kubernetes-release/release/v1.21.0/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl > /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl
RUN BIN_URL=https://storage.googleapis.com/kubernetes-release/release/v1.21.0/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl \
&& SHA512=$( wget -qO- "$BIN_URL.sha512" ) \
&& [ -n "$SHA512" ] \
&& wget -qO- "$BIN_URL" > /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl \
&& sha512sum /usr/local/bin/kubectl | grep "$SHA512"

CMD [ "/usr/local/bin/kubectl" ]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# When $TARGETPLATFORM is linux/arm/v7, strip out the '/v6' or '/v7' from it
RUN wget -qO- https://storage.googleapis.com/kubernetes-release/release/v1.21.0/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl > /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl
RUN BIN_URL=https://storage.googleapis.com/kubernetes-release/release/v1.21.0/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl \
&& SHA512=$( wget -qO- "$BIN_URL.sha512" ) \
&& [ -n "$SHA512" ] \
&& wget -qO- "$BIN_URL" > /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl \
&& sha512sum /usr/local/bin/kubectl | grep "$SHA512"

# From: https://github.com/nginxinc/docker-nginx/blob/1.17.0/stable/alpine/Dockerfile
# Bring in gettext so we can get `envsubst`, then throw
Expand Down
7 changes: 6 additions & 1 deletion variants/v1.22.0-alpine-3.8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# When $TARGETPLATFORM is linux/arm/v7, strip out the '/v6' or '/v7' from it
RUN wget -qO- https://storage.googleapis.com/kubernetes-release/release/v1.22.0/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl > /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl
RUN BIN_URL=https://storage.googleapis.com/kubernetes-release/release/v1.22.0/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl \
&& SHA512=$( wget -qO- "$BIN_URL.sha512" ) \
&& [ -n "$SHA512" ] \
&& wget -qO- "$BIN_URL" > /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl \
&& sha512sum /usr/local/bin/kubectl | grep "$SHA512"

CMD [ "/usr/local/bin/kubectl" ]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# When $TARGETPLATFORM is linux/arm/v7, strip out the '/v6' or '/v7' from it
RUN wget -qO- https://storage.googleapis.com/kubernetes-release/release/v1.22.0/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl > /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl
RUN BIN_URL=https://storage.googleapis.com/kubernetes-release/release/v1.22.0/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl \
&& SHA512=$( wget -qO- "$BIN_URL.sha512" ) \
&& [ -n "$SHA512" ] \
&& wget -qO- "$BIN_URL" > /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl \
&& sha512sum /usr/local/bin/kubectl | grep "$SHA512"

# From: https://github.com/nginxinc/docker-nginx/blob/1.17.0/stable/alpine/Dockerfile
# Bring in gettext so we can get `envsubst`, then throw
Expand Down

0 comments on commit c55bd3a

Please sign in to comment.