Skip to content

Commit fb3616c

Browse files
authored
fix(scripts): wget terraform directly from releases.hashicorp.com (#9594)
1 parent 11b6068 commit fb3616c

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

scripts/Dockerfile.base

+9-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ RUN apk add --no-cache \
1212
bash \
1313
git \
1414
openssh-client && \
15-
# Use the edge repo, since Terraform doesn't seem to be backported to 3.18.
16-
apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community \
17-
terraform=~1.5 && \
1815
addgroup \
1916
-g 1000 \
2017
coder && \
@@ -25,6 +22,15 @@ RUN apk add --no-cache \
2522
-u 1000 \
2623
-G coder \
2724
coder
25+
# Terraform was disabled in the edge repo due to a build issue.
26+
# https://gitlab.alpinelinux.org/alpine/aports/-/commit/f3e263d94cfac02d594bef83790c280e045eba35
27+
# Using wget for now. Note that busybox unzip doesn't support streaming.
28+
ARG ARCH
29+
RUN wget -O /tmp/terraform.zip "https://releases.hashicorp.com/terraform/1.5.6/terraform_1.5.6_linux_${ARCH}.zip" && \
30+
busybox unzip /tmp/terraform.zip -d /usr/local/bin && \
31+
rm -f /tmp/terraform.zip && \
32+
chmod +x /usr/local/bin/terraform && \
33+
terraform --version
2834

2935
USER 1000:1000
3036
ENV HOME=/home/coder

scripts/build_docker.sh

+2
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ declare -A arch_map=(
103103
[arm]="linux/arm/v7"
104104
[armv7]="linux/arm/v7"
105105
)
106+
orig_arch="$arch"
106107
if [[ "${arch_map[$arch]+exists}" != "" ]]; then
107108
arch="${arch_map[$arch]}"
108109
fi
@@ -124,6 +125,7 @@ if [[ "$build_base" != "" ]]; then
124125
log "--- Building base Docker image for $arch ($build_base)"
125126
docker build \
126127
--platform "$arch" \
128+
--build-arg "ARCH=${orig_arch}" \
127129
--tag "$build_base" \
128130
--no-cache \
129131
-f Dockerfile.base \

0 commit comments

Comments
 (0)