Skip to content

Commit e88073f

Browse files
committed
wget terraform directly from releases.hashicorp.com
1 parent 8b51a2f commit e88073f

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

scripts/Dockerfile.base

Lines changed: 10 additions & 3 deletions
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,16 @@ 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 / && \
31+
mv /terraform /usr/local/bin/terraform && \
32+
rm -f /tmp/terraform.zip && \
33+
chmod +x /usr/local/bin/terraform && \
34+
terraform --version
2835

2936
USER 1000:1000
3037
ENV HOME=/home/coder

scripts/build_docker.sh

Lines changed: 2 additions & 0 deletions
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)