|
1 |
| -FROM debian:bookworm-slim |
| 1 | +FROM --platform=$BUILDPLATFORM debian:bookworm-slim |
| 2 | + |
| 3 | +ARG TARGETPLATFORM |
| 4 | +ARG BUILDPLATFORM |
| 5 | + |
| 6 | +# Set the Atmos version (without the v prefix) |
2 | 7 | ARG ATMOS_VERSION
|
| 8 | +ARG OS=linux |
| 9 | +ARG ARCH=amd64 |
3 | 10 |
|
4 |
| -RUN apt-get update && apt-get install -y curl |
| 11 | +RUN apt-get update && apt-get install -y curl git |
5 | 12 |
|
| 13 | +# Install the Cloud Posse Debian repository |
6 | 14 | RUN curl -1sLf 'https://dl.cloudsmith.io/public/cloudposse/packages/cfg/setup/bash.deb.sh' | bash
|
7 | 15 |
|
8 |
| -RUN apt-get update && apt-get install -y terraform helmfile |
| 16 | +# Install OpenTofu |
| 17 | +RUN curl -1sSLf 'https://get.opentofu.org/install-opentofu.sh' | bash -s -- --root-method none --install-method deb |
| 18 | + |
| 19 | +# Install Kustomize binary (required by Helmfile) |
| 20 | +RUN curl -1sSLf "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash -s -- /usr/local/bin |
| 21 | + |
| 22 | +# Install toolchain used with Atmos |
| 23 | +RUN apt-get -y install terraform kubectl helmfile helm |
9 | 24 |
|
10 |
| -ADD https://github.com/cloudposse/atmos/releases/download/${ATMOS_VERSION}/atmos_${ATMOS_VERSION}_${OS}_${ARCH} /usr/local/bin/atmos |
| 25 | +# Install the helm-diff plugin required by Helmfile |
| 26 | +RUN helm plugin install https://github.com/databus23/helm-diff |
11 | 27 |
|
12 |
| -RUN chmod +x /usr/local/bin/atmos |
| 28 | +# Install Atmos |
| 29 | +RUN case ${TARGETPLATFORM} in \ |
| 30 | + "linux/amd64") \ |
| 31 | + OS=linux; ARCH=amd64 ;; \ |
| 32 | + "linux/arm64") \ |
| 33 | + OS=linux; ARCH=arm64 ;; \ |
| 34 | + *) \ |
| 35 | + echo "Unsupported platform: ${TARGETPLATFORM}" && exit 1 ;; \ |
| 36 | + esac && \ |
| 37 | + ATMOS_VERSION=${ATMOS_VERSION#v} && \ |
| 38 | + curl -1sSLf "https://github.com/cloudposse/atmos/releases/download/v${ATMOS_VERSION}/atmos_${ATMOS_VERSION}_${OS}_${ARCH}" -o /usr/local/bin/atmos && \ |
| 39 | + chmod +x /usr/local/bin/atmos |
0 commit comments