diff --git a/package/Dockerfile b/package/Dockerfile index d545e5a9..7cc7c9b8 100644 --- a/package/Dockerfile +++ b/package/Dockerfile @@ -1,10 +1,28 @@ +ARG BUILD_ENV=docker +ARG ARCH + FROM registry.suse.com/bci/bci-base:15.5 RUN zypper -n update && \ zypper -n install openssh catatonit git-core && \ zypper -n clean -a RUN useradd -u 1000 -U -m gitjob -COPY bin/gitjob /usr/bin/ -COPY bin/gitcloner /usr/bin + +FROM base AS copy_docker +ONBUILD ARG ARCH +ONBUILD COPY bin/gitjob /usr/bin/gitjob +ONBUILD COPY bin/gitcloner /usr/bin/gitcloner + +FROM base AS copy_buildx +ONBUILD ARG TARGETARCH +ONBUILD COPY bin/gitjob-linux-$TARGETARCH /usr/bin/gitjob +ONBUILD COPY bin/gitcloner-linux-$TARGETARCH /usr/bin/gitcloner + +FROM base AS copy_goreleaser +ONBUILD ARG ARCH +ONBUILD COPY gitjob-linux-${ARCH} /usr/bin/gitjob +ONBUILD COPY gitcloner-linux-${ARCH} /usr/bin/gitcloner + +FROM copy_${BUILD_ENV} USER 1000 ENTRYPOINT ["catatonit", "--"] CMD ["gitjob"]