-
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add docker build * create multi-platform dockerfile * install from release page * fix github workflow syntax * test for ATMOS_VERSION * lint the dockerfile * fix github workflow syntax * output summary * output summary * add sarif * add sarif * combine layers * Ignore version pinning * fix input parameters * need release
- Loading branch information
Showing
3 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Use a base image with platform specification | ||
FROM --platform=$BUILDPLATFORM debian:bookworm-slim | ||
|
||
# Define the arguments for Atmos version and platforms | ||
ARG TARGETPLATFORM | ||
ARG BUILDPLATFORM | ||
ARG ATMOS_VERSION | ||
|
||
# Check if ATMOS_VERSION is set | ||
RUN if [ -z "$ATMOS_VERSION" ]; then echo "ERROR: ATMOS_VERSION argument must be set" && exit 1; fi | ||
|
||
# Set SHELL to use bash and enable pipefail | ||
SHELL ["/bin/bash", "-eo", "pipefail", "-c"] | ||
|
||
RUN set -ex; \ | ||
# Update the package list | ||
apt-get update; \ | ||
# Install curl and git | ||
apt-get -y install --no-install-recommends curl git ca-certificates; \ | ||
# Install the Cloud Posse Debian repository | ||
curl -1sLf 'https://dl.cloudsmith.io/public/cloudposse/packages/cfg/setup/bash.deb.sh' | bash -x; \ | ||
# Install OpenTofu | ||
curl -1sSLf 'https://get.opentofu.org/install-opentofu.sh' | bash -s -- --root-method none --install-method deb; \ | ||
# Install Kustomize binary (required by Helmfile) | ||
curl -1sSLf "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash -s -- /usr/local/bin; \ | ||
# Install toolchain used with Atmos \ | ||
apt-get -y install --no-install-recommends terraform kubectl helmfile helm; \ | ||
# Install the helm-diff plugin required by Helmfile | ||
helm plugin install https://github.com/databus23/helm-diff; \ | ||
# Clean up the package lists to keep the image clean | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Atmos from the GitHub Release | ||
RUN case ${TARGETPLATFORM} in \ | ||
"linux/amd64") OS=linux; ARCH=amd64 ;; \ | ||
"linux/arm64") OS=linux; ARCH=arm64 ;; \ | ||
*) echo "Unsupported platform: ${TARGETPLATFORM}" && exit 1 ;; \ | ||
esac && \ | ||
ATMOS_VERSION=${ATMOS_VERSION#v} && \ | ||
echo "Downloading Atmos v${ATMOS_VERSION} for ${OS}/${ARCH}" && \ | ||
curl -1sSLf "https://github.com/cloudposse/atmos/releases/download/v${ATMOS_VERSION}/atmos_${ATMOS_VERSION}_${OS}_${ARCH}" -o /usr/local/bin/atmos && \ | ||
chmod +x /usr/local/bin/atmos |