Verify packer checksum and signature
This commit is contained in:
parent
cee9979679
commit
b80b030d36
2 changed files with 51 additions and 4 deletions
|
|
@ -2,6 +2,8 @@ FROM docker
|
|||
|
||||
RUN apk add --no-cache \
|
||||
ca-certificates \
|
||||
coreutils \
|
||||
gnupg \
|
||||
libffi \
|
||||
mktorrent \
|
||||
openssh-client \
|
||||
|
|
@ -22,10 +24,24 @@ RUN apk add --no-cache \
|
|||
|
||||
ARG PACKER_VERSION
|
||||
|
||||
RUN mkdir -p /usr/local/bin \
|
||||
&& wget -O /tmp/packer.zip -c https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip \
|
||||
&& unzip /tmp/packer.zip -d /usr/local/bin \
|
||||
&& rm -f /tmp/packer.zip \
|
||||
COPY hashicorp.asc /usr/local/share/
|
||||
|
||||
RUN gpg --import /usr/local/share/hashicorp.asc \
|
||||
&& mkdir -p \
|
||||
/usr/local/bin \
|
||||
/tmp/packer \
|
||||
&& (cd /tmp/packer \
|
||||
&& wget --no-verbose \
|
||||
https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip \
|
||||
https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_SHA256SUMS \
|
||||
https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_SHA256SUMS.sig \
|
||||
&& gpg --verify \
|
||||
packer_${PACKER_VERSION}_SHA256SUMS.sig \
|
||||
packer_${PACKER_VERSION}_SHA256SUMS \
|
||||
&& sha256sum -c --strict --ignore-missing packer_${PACKER_VERSION}_SHA256SUMS | grep -F "packer_${PACKER_VERSION}_linux_amd64.zip: OK" \
|
||||
&& unzip *.zip -d /usr/local/bin \
|
||||
&& rm -f /tmp/packer.zip \
|
||||
) \
|
||||
&& mkdir /workdir
|
||||
|
||||
WORKDIR /workdir
|
||||
|
|
@ -33,3 +49,4 @@ WORKDIR /workdir
|
|||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
||||
# vim: ts=4 sw=4 sts=4 noet:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue