Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: distribute multiplatform images #330

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading