mirror of https://github.com/coder/coder.git
fix(scripts): modify logic for determining terraform arch (#9595)
Commit fb3616c
used a build-arg to set the desired terrafomr
architeture to fetch. This is set in build_docker.sh but not
when building using depot.dev. Baking the logic into the
Dockerfile instead.
This commit is contained in:
parent
8d7eb1728c
commit
a3a16a1586
|
@ -25,13 +25,11 @@ RUN apk add --no-cache \
|
||||||
# Terraform was disabled in the edge repo due to a build issue.
|
# Terraform was disabled in the edge repo due to a build issue.
|
||||||
# https://gitlab.alpinelinux.org/alpine/aports/-/commit/f3e263d94cfac02d594bef83790c280e045eba35
|
# https://gitlab.alpinelinux.org/alpine/aports/-/commit/f3e263d94cfac02d594bef83790c280e045eba35
|
||||||
# Using wget for now. Note that busybox unzip doesn't support streaming.
|
# Using wget for now. Note that busybox unzip doesn't support streaming.
|
||||||
ARG ARCH
|
RUN ARCH="$(arch)"; if [ "${ARCH}" == "x86_64" ]; then ARCH="amd64"; fi; wget -O /tmp/terraform.zip "https://releases.hashicorp.com/terraform/1.5.6/terraform_1.5.6_linux_${ARCH}.zip" && \
|
||||||
RUN wget -O /tmp/terraform.zip "https://releases.hashicorp.com/terraform/1.5.6/terraform_1.5.6_linux_${ARCH}.zip" && \
|
|
||||||
busybox unzip /tmp/terraform.zip -d /usr/local/bin && \
|
busybox unzip /tmp/terraform.zip -d /usr/local/bin && \
|
||||||
rm -f /tmp/terraform.zip && \
|
rm -f /tmp/terraform.zip && \
|
||||||
chmod +x /usr/local/bin/terraform && \
|
chmod +x /usr/local/bin/terraform && \
|
||||||
terraform --version
|
terraform --version
|
||||||
|
|
||||||
USER 1000:1000
|
USER 1000:1000
|
||||||
ENV HOME=/home/coder
|
ENV HOME=/home/coder
|
||||||
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt
|
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt
|
||||||
|
|
|
@ -103,7 +103,6 @@ declare -A arch_map=(
|
||||||
[arm]="linux/arm/v7"
|
[arm]="linux/arm/v7"
|
||||||
[armv7]="linux/arm/v7"
|
[armv7]="linux/arm/v7"
|
||||||
)
|
)
|
||||||
orig_arch="$arch"
|
|
||||||
if [[ "${arch_map[$arch]+exists}" != "" ]]; then
|
if [[ "${arch_map[$arch]+exists}" != "" ]]; then
|
||||||
arch="${arch_map[$arch]}"
|
arch="${arch_map[$arch]}"
|
||||||
fi
|
fi
|
||||||
|
@ -125,7 +124,6 @@ if [[ "$build_base" != "" ]]; then
|
||||||
log "--- Building base Docker image for $arch ($build_base)"
|
log "--- Building base Docker image for $arch ($build_base)"
|
||||||
docker build \
|
docker build \
|
||||||
--platform "$arch" \
|
--platform "$arch" \
|
||||||
--build-arg "ARCH=${orig_arch}" \
|
|
||||||
--tag "$build_base" \
|
--tag "$build_base" \
|
||||||
--no-cache \
|
--no-cache \
|
||||||
-f Dockerfile.base \
|
-f Dockerfile.base \
|
||||||
|
|
Loading…
Reference in New Issue