2023-02-07 03:30:35 +11:00
|
|
|
# This is the base image used for Coder images. It's a multi-arch image that is
|
|
|
|
|
# built in depot.dev for all supported architectures. Since it's built on real
|
|
|
|
|
# hardware and not cross-compiled, it can have "RUN" commands.
|
2026-10-26 18:47:25 -05:00
|
|
|
FROM alpine:3.24.3@sha256:be2656061b536c1883c4034790e21d0a09c5aaaf51968b89368a3c0371ea2c9a
|
2023-02-07 03:30:35 +11:00
|
|
|
|
|
|
|
|
# We use a single RUN command to reduce the number of layers in the image.
|
2023-03-07 13:52:45 +00:00
|
|
|
# NOTE: Keep the Terraform version in sync with minTerraformVersion and
|
|
|
|
|
# maxTerraformVersion in provisioner/terraform/install.go.
|
2023-02-07 03:30:35 +11:00
|
|
|
RUN apk add --no-cache \
|
|
|
|
|
curl \
|
|
|
|
|
wget \
|
|
|
|
|
bash \
|
2024-05-30 15:58:32 +02:00
|
|
|
git \
|
2023-11-14 13:40:30 -06:00
|
|
|
openssl \
|
2025-10-30 14:08:06 +00:00
|
|
|
openssh-client \
|
|
|
|
|
tzdata && \
|
2023-02-07 03:30:35 +11:00
|
|
|
addgroup \
|
|
|
|
|
-g 1000 \
|
|
|
|
|
coder && \
|
|
|
|
|
adduser \
|
|
|
|
|
-D \
|
|
|
|
|
-s /bin/bash \
|
|
|
|
|
-h /home/coder \
|
|
|
|
|
-u 1000 \
|
|
|
|
|
-G coder \
|
|
|
|
|
coder
|
2023-09-08 11:02:18 +01:00
|
|
|
# Terraform was disabled in the edge repo due to a build issue.
|
|
|
|
|
# https://gitlab.alpinelinux.org/alpine/aports/-/commit/f3e263d94cfac02d594bef83790c280e045eba35
|
|
|
|
|
# Using wget for now. Note that busybox unzip doesn't support streaming.
|
2026-11-25 14:07:03 -07:00
|
|
|
#
|
|
|
|
|
# The Terraform version and SHA256 come from terraform_SHA256SUMS, a copy of
|
|
|
|
|
# provisioner/terraform/terraform_SHA256SUMS (HashiCorp's GPG-signed checksum
|
|
|
|
|
# file). Every build context for this Dockerfile must include it. The build
|
|
|
|
|
# fails if there's no entry for this architecture or the download doesn't match.
|
|
|
|
|
COPY terraform_SHA256SUMS /tmp/terraform_SHA256SUMS
|
|
|
|
|
RUN ARCH="$(arch)"; if [ "${ARCH}" == "x86_64" ]; then ARCH="amd64"; elif [ "${ARCH}" == "aarch64" ]; then ARCH="arm64"; elif [ "${ARCH}" == "armv7l" ]; then ARCH="arm"; fi; cd /tmp && \
|
|
|
|
|
ZIP="$(grep -oE "terraform_[0-9]+\.[0-9]+\.[0-9]+_linux_${ARCH}\.zip$" terraform_SHA256SUMS)" && \
|
|
|
|
|
VERSION="$(echo "${ZIP}" | cut -d_ -f2)" && \
|
|
|
|
|
wget "https://releases.hashicorp.com/terraform/${VERSION}/${ZIP}" && \
|
|
|
|
|
grep -E " ${ZIP}$" terraform_SHA256SUMS | sha256sum -c - && \
|
|
|
|
|
busybox unzip "${ZIP}" -d /usr/local/bin && \
|
|
|
|
|
rm -f "${ZIP}" terraform_SHA256SUMS && \
|
2023-09-08 11:02:18 +01:00
|
|
|
chmod +x /usr/local/bin/terraform && \
|
|
|
|
|
terraform --version
|
2023-02-07 03:30:35 +11:00
|
|
|
USER 1000:1000
|
|
|
|
|
ENV HOME=/home/coder
|
|
|
|
|
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt
|
|
|
|
|
WORKDIR /home/coder
|