Files
coder/scripts/Dockerfile.base
T
coder[bot] 11aaca1d85 fix: bump bundled terraform to 1.17.1 (#31438)
Bumps the bundled Terraform from 1.16.7 to
[1.17.1](https://github.com/hashicorp/terraform/releases/tag/v1.17.1)
(released 2026-10-28). 1.17.1 is built with `go-jose/v4` v4.1.6, which
fixes
[GHSA-mgcc-cww5-fp2q](https://github.com/go-jose/go-jose/security/advisories/GHSA-mgcc-cww5-fp2q)
(CPU DoS through crafted RSA JWKs). Terraform 1.16.7, 1.17.0 and the
current `v1.16` branch all still pin go-jose v4.1.4, so there's no
1.16.x release with the fix to move to yet.

The IronBank VAT scan of `coder-service-2:2.38.3` flags
`/opt/terraform/terraform` (High) for this. The 2.38 backport is #31441.

This is a minor bump, so `maxTerraformVersion` moves from 1.16.9 to
1.17.9. Same file set as #31301:

- `provisioner/terraform/install.go`: `TerraformVersion` and
`maxTerraformVersion`
- `install.sh`, `scripts/Dockerfile.base`,
`docs/install/prepare/airgap.md`
- `mise.toml`, `mise.lock`, `flake.nix`: checksums from
`terraform_1.17.1_SHA256SUMS`, GPG-verified against HashiCorp's signing
key (C874 011F 0AB4 0511 0D02 1055 3436 5D94 72D7 468F). The flake SRI
hashes come from the same file.
- `provisioner/terraform/testdata/generation.sha1`: regenerated with
`generate.sh` under Terraform 1.17.1. No fixture outputs changed.

Verified: `go test ./provisioner/terraform/` passes with Terraform
1.17.1 on `PATH`. Local git hooks were skipped; CI is the gate.

Part of [ENT-228](https://linear.app/codercom/issue/ENT-228) (parent
[ENT-230](https://linear.app/codercom/issue/ENT-230)). 2.38 backport:
#31441.

Opened by Superblink on behalf of @droopy4096.

Co-authored-by: coder[bot] <137810501+coder[bot]@users.noreply.github.com>
2026-11-02 18:30:55 +00:00

39 lines
1.5 KiB
Docker

# 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.
FROM alpine:3.24.3@sha256:be2656061b536c1883c4034790e21d0a09c5aaaf51968b89368a3c0371ea2c9a
# We use a single RUN command to reduce the number of layers in the image.
# NOTE: Keep the Terraform version in sync with minTerraformVersion and
# maxTerraformVersion in provisioner/terraform/install.go.
RUN apk add --no-cache \
curl \
wget \
bash \
git \
openssl \
openssh-client \
tzdata && \
addgroup \
-g 1000 \
coder && \
adduser \
-D \
-s /bin/bash \
-h /home/coder \
-u 1000 \
-G coder \
coder
# 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.
RUN ARCH="$(arch)"; if [ "${ARCH}" == "x86_64" ]; then ARCH="amd64"; elif [ "${ARCH}" == "aarch64" ]; then ARCH="arm64"; elif [ "${ARCH}" == "armv7l" ]; then ARCH="arm"; fi; wget -O /tmp/terraform.zip "https://releases.hashicorp.com/terraform/1.17.1/terraform_1.17.1_linux_${ARCH}.zip" && \
busybox unzip /tmp/terraform.zip -d /usr/local/bin && \
rm -f /tmp/terraform.zip && \
chmod +x /usr/local/bin/terraform && \
terraform --version
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