Skip to content

Commit

Permalink
feat: distribute multiplatform images
Browse files Browse the repository at this point in the history
  • Loading branch information
JonZeolla committed Jul 25, 2024
1 parent 3e4d539 commit bdebb5f
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 11 deletions.
3 changes: 2 additions & 1 deletion build/Dockerfile.ansible
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG EASY_INFRA_TAG

FROM seiso/easy_infra_base:"${EASY_INFRA_TAG}" AS ansible
ARG TARGETPLATFORM
FROM --platform=$TARGETPLATFORM seiso/easy_infra_base:"${EASY_INFRA_TAG}" AS ansible

ARG ANSIBLE_VERSION
ENV ANSIBLE_VERSION="${ANSIBLE_VERSION}"
Expand Down
3 changes: 2 additions & 1 deletion build/Dockerfile.ansible-aws
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG EASY_INFRA_TAG_TOOL_ONLY

FROM seiso/easy_infra:"${EASY_INFRA_TAG_TOOL_ONLY}" AS ansible-aws
ARG TARGETPLATFORM
FROM --platform=$TARGETPLATFORM seiso/easy_infra:"${EASY_INFRA_TAG_TOOL_ONLY}" AS ansible-aws

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN ansible-galaxy collection install amazon.aws
3 changes: 2 additions & 1 deletion build/Dockerfile.ansible-azure
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG EASY_INFRA_TAG_TOOL_ONLY

FROM seiso/easy_infra:"${EASY_INFRA_TAG_TOOL_ONLY}" AS ansible-azure
ARG TARGETPLATFORM
FROM --platform=$TARGETPLATFORM seiso/easy_infra:"${EASY_INFRA_TAG_TOOL_ONLY}" AS ansible-azure

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN ansible-galaxy collection install azure.azcollection
3 changes: 2 additions & 1 deletion build/Dockerfile.aws-cli
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG EASY_INFRA_TAG

FROM seiso/easy_infra_base:"${EASY_INFRA_TAG}" AS aws-cli
ARG TARGETPLATFORM
FROM --platform=$TARGETPLATFORM seiso/easy_infra_base:"${EASY_INFRA_TAG}" AS aws-cli

ARG AWS_CLI_ARCH
ARG AWS_CLI_VERSION
Expand Down
3 changes: 2 additions & 1 deletion build/Dockerfile.azure-cli
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG EASY_INFRA_TAG

FROM seiso/easy_infra_base:"${EASY_INFRA_TAG}" AS azure-cli
ARG TARGETPLATFORM
FROM --platform=$TARGETPLATFORM seiso/easy_infra_base:"${EASY_INFRA_TAG}" AS azure-cli

ARG AZURE_CLI_VERSION
ENV AZURE_CLI_VERSION="${AZURE_CLI_VERSION}"
Expand Down
4 changes: 3 additions & 1 deletion build/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ ARG EASY_INFRA_TAG
# https://docs.docker.com/engine/reference/builder/#scope
ARG EASY_INFRA_TAG_TOOL_ONLY

# TARGETPLATFORM is special cased by docker and doesn't need the initial ARG
# https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
# The dockerfile base must start with FROM ... AS base
FROM "${FROM_IMAGE}":"${FROM_IMAGE_TAG}" AS base
FROM --platform=$TARGETPLATFORM "${FROM_IMAGE}":"${FROM_IMAGE_TAG}" AS base

ARG BUILDARCH
ARG TRACE="false"
Expand Down
3 changes: 2 additions & 1 deletion build/Dockerfile.checkov
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG EASY_INFRA_TAG

FROM seiso/easy_infra_base:"${EASY_INFRA_TAG}" AS checkov
ARG TARGETPLATFORM
FROM --platform=$TARGETPLATFORM seiso/easy_infra_base:"${EASY_INFRA_TAG}" AS checkov

ARG CHECKOV_VERSION
ENV CHECKOV_VERSION="${CHECKOV_VERSION}"
Expand Down
3 changes: 2 additions & 1 deletion build/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ ARG {{ argument }}
{{ dockerfile }}
{% endfor %}

FROM base as final
ARG TARGETPLATFORM
FROM --platform=$TARGETPLATFORM base as final

USER easy_infra

Expand Down
3 changes: 2 additions & 1 deletion build/Dockerfile.kics
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG KICS_VERSION

FROM checkmarx/kics:"${KICS_VERSION}-debian" AS kics
ARG TARGETPLATFORM
FROM --platform=$TARGETPLATFORM checkmarx/kics:"${KICS_VERSION}-debian" AS kics

ARG KICS_VERSION
ENV KICS_VERSION="${KICS_VERSION}"
Expand Down
3 changes: 2 additions & 1 deletion build/Dockerfile.opentofu
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG EASY_INFRA_TAG

FROM seiso/easy_infra_base:"${EASY_INFRA_TAG}" AS opentofu
ARG TARGETPLATFORM
FROM --platform=$TARGETPLATFORM seiso/easy_infra_base:"${EASY_INFRA_TAG}" AS opentofu

ARG BUILDARCH
ARG OPENTOFU_VERSION
Expand Down
3 changes: 2 additions & 1 deletion build/Dockerfile.terraform
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG EASY_INFRA_TAG

FROM seiso/easy_infra_base:"${EASY_INFRA_TAG}" AS terraform
ARG TARGETPLATFORM
FROM --platform=$TARGETPLATFORM seiso/easy_infra_base:"${EASY_INFRA_TAG}" AS terraform

ARG BUILDARCH
ARG TERRAFORM_VERSION
Expand Down

0 comments on commit bdebb5f

Please sign in to comment.