Created
December 12, 2022 17:36
-
-
Save jleach/6b7d7608bbff8e44a9539f811fa08836 to your computer and use it in GitHub Desktop.
Andible runner image that will work for ARM64 and AMD64 architecture
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
FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi8/ubi:latest | |
ENV TINI_VERSION=v0.19.0 | |
ENV KUBESEAL_VERSION=v0.19.2 | |
ENV KUSTOMIZE_VERSION=v4.5.7 | |
ENV HELM_VERSION=v3.10.2 | |
ARG TARGETARCH | |
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /bin/tini | |
ADD bin/entrypoint.sh /bin/entrypoint | |
RUN dnf install -y git hostname jq python3 python3-pip && \ | |
pip3 install --upgrade pip && \ | |
pip install ansible molecule yamllint flake8 ansible-lint openshift kubernetes jq pyjwt jmespath && \ | |
chmod +x /bin/tini /bin/entrypoint && \ | |
rm -rf /var/cache/dnf | |
RUN curl -LOJ https://github.com/bitnami-labs/sealed-secrets/releases/download/${KUBESEAL_VERSION}/kubeseal-linux-${TARGETARCH} && \ | |
mv kubeseal-linux-${TARGETARCH} /bin/kubeseal && \ | |
chmod +x /bin/kubeseal | |
RUN curl -L https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2F${KUSTOMIZE_VERSION}/kustomize_${KUSTOMIZE_VERSION}_linux_${TARGETARCH}.tar.gz | \ | |
tar -xz && \ | |
mv kustomize /bin/kustomize | |
RUN curl -L https://get.helm.sh/helm-${HELM_VERSION}-linux-${TARGETARCH}.tar.gz | \ | |
tar -xz && \ | |
mv linux-${TARGETARCH}/helm /bin/helm | |
ENV HOME=/ansible | |
RUN mkdir -p ${HOME} ${HOME}/.ansible/tmp | |
COPY . /ansible | |
RUN chmod -R g+w ${HOME} && chgrp -R root ${HOME} | |
WORKDIR /ansible | |
ENTRYPOINT ["entrypoint"] | |
CMD ["sleep", "infinity"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To build for both platforms you can use:
docker buildx build --platform=linux/amd64,linux/arm64 --push -t fullboar/gitops-runner:v0.2.0 .
The
--push
arg expects a registry where it can push to. You can't (as of yet) load multi-architecture image into your local repository. If you want to use it locally build for the architecture of your current platform with:docker buildx build --platform=linux/arm64 --load -t gitops-runner:v0.2.0 .