From 0b5b163bc2efdec8883e1b110aa5373a9b09fbc7 Mon Sep 17 00:00:00 2001 From: Adar Nimrod <nimrod@shore.co.il> Date: Sat, 12 Mar 2022 21:00:18 +0200 Subject: [PATCH] Add the Hashicorp repository to the pre-commit image. Sometimes Terraform or Packer are needed. This will make it as all that will be needed is an `apt-get update && apt-get install -y terraform` without making the image bigger than it needs to be. --- images/pre-commit/Dockerfile | 6 +++++- images/pre-commit/sources.d/hashicorp.sources | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 images/pre-commit/sources.d/hashicorp.sources diff --git a/images/pre-commit/Dockerfile b/images/pre-commit/Dockerfile index 6794071..f1d9927 100644 --- a/images/pre-commit/Dockerfile +++ b/images/pre-commit/Dockerfile @@ -1,6 +1,10 @@ FROM buildpack-deps:bullseye +COPY --chown=root:root sources.d/* /etc/apt/sources.list.d/ +SHELL ["/bin/ash", "-eo", "pipefail", "-c"] # hadolint ignore=DL3008,DL3013 -RUN apt-get update && \ +RUN curl -fsSL https://apt.releases.hashicorp.com/gpg | \ + gpg --no-default-keyring --import --batch --keyring /usr/share/keyrings/hashicorp.gpg && \ + apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ docker.io \ python3-dev \ diff --git a/images/pre-commit/sources.d/hashicorp.sources b/images/pre-commit/sources.d/hashicorp.sources new file mode 100644 index 0000000..f01300c --- /dev/null +++ b/images/pre-commit/sources.d/hashicorp.sources @@ -0,0 +1,5 @@ +Types: deb +URIs: https://apt.releases.hashicorp.com +Suites: buster +Components: main +Signed-By: /usr/share/keyrings/hashicorp.gpg -- GitLab