Skip to content

Commit

Permalink
Upgrade packer to 1.8.3 (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimgus authored Aug 24, 2022
1 parent d7e19bb commit a07d7a8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ FROM debian:11.4-slim
#Base
RUN apt-get update -y && \
apt-get install -y git curl openssl pip make unzip gpg wget && \
apt-get install -y ansible=2.10.7+merged+base+2.10.8+dfsg-1 && \
apt-get install -y packer=1.6.6+ds1-2+b3
apt-get install -y ansible=2.10.7+merged+base+2.10.8+dfsg-1

RUN pip --no-cache-dir install -U pip

Expand Down Expand Up @@ -77,6 +76,10 @@ RUN /usr/src/install-scripts/helm.sh --version="v3.9.2" --sha="3f5be38068a182967
COPY --from=tf-prepare-builder /workspace/tf-prepare /usr/local/bin/tf-prepare
RUN chmod +x /usr/local/bin/tf-prepare

# Install packer
COPY install-scripts/packer.sh /usr/src/install-scripts/packer.sh
RUN /usr/src/install-scripts/packer.sh --version="1.8.3" --sha="0587f7815ed79589cd9c2b754c82115731c8d0b8fd3b746fe40055d969facba5"

#Cleanup
RUN apt-get autoremove && \
apt-get clean
Expand Down
29 changes: 29 additions & 0 deletions docker/install-scripts/packer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
set -e

while [ $# -gt 0 ]; do
case "$1" in
--version=*)
VERSION="${1#*=}"
;;
--sha=*)
SHA="${1#*=}"
;;
*)
echo "Error: Invalid argument."
exit 1
esac
shift
done

wget https://releases.hashicorp.com/packer/${VERSION}/packer_${VERSION}_linux_amd64.zip
DOWNLOAD_SHA=$(openssl sha1 -sha256 packer_${VERSION}_linux_amd64.zip | awk '{print $2}')
if [[ "${SHA}" != "${DOWNLOAD_SHA}" ]]; then
echo "Downloaded checksum (${DOWNLOAD_SHA}) does not match expected value: ${SHA}"
exit 1
fi

unzip packer_${VERSION}_linux_amd64.zip
rm packer_${VERSION}_linux_amd64.zip
chmod +x packer
mv packer /usr/local/bin/packer

0 comments on commit a07d7a8

Please sign in to comment.