Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hashicorp packer #79

Merged
merged 1 commit into from
Oct 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions linux/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,17 @@ RUN URL=$(curl -fsSL https://api.releases.hashicorp.com/v1/releases/terraform/la
-d "${PATH_LOCAL_BINS}" \
&& terraform --version

FROM base as packer
ARG TARGETARCH
ARG PATH_LOCAL_BINS
SHELL [ "/bin/bash", "--login", "-e", "-o", "pipefail", "-c" ]
RUN URL=$(curl -fsSL https://api.releases.hashicorp.com/v1/releases/packer/latest | jq --arg arch "${TARGETARCH}" -r '.builds[] | select((.arch==$arch) and (.os=="linux")).url') \
&& ZIP_NAME="packer_linux_amd64.zip" \
&& curl -fsSL "${URL}" -o "/tmp/${ZIP_NAME}" \
&& unzip -qq "/tmp/${ZIP_NAME}" -d "${PATH_LOCAL_BINS}" \
&& packer --version \
&& rm -f "/tmp/${ZIP_NAME}"

FROM base as rust
ARG TARGETARCH
SHELL [ "/bin/bash", "--login", "-e", "-o", "pipefail", "-c" ]
Expand Down Expand Up @@ -471,6 +482,9 @@ COPY --link --from=pypy "${AGENT_TOOLSDIRECTORY}/PyPy" "${AGENT_TOOLSDIRECTORY}/
# add terraform
COPY --link --from=terraform "${PATH_LOCAL_BINS}/terraform" "${PATH_LOCAL_BINS}/terraform"

# add packer
COPY --link --from=packer "${PATH_LOCAL_BINS}/packer" "${PATH_LOCAL_BINS}/packer"

# add rust
ARG CARGO_HOME
COPY --link --from=rust "${CARGO_HOME}" "${CARGO_HOME}"
Expand Down