0
0
mirror of https://github.com/thegeeklab/wp-opentofu.git synced 2024-11-22 00:30:40 +00:00
wp-opentofu/Containerfile.multiarch

39 lines
1.4 KiB
Plaintext

FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.22@sha256:0b55ab82ac2a54a6f8f85ec8b943b9e470c39e32c109b766bbc1b801f3fa8d3b as build
ARG TARGETOS
ARG TARGETARCH
ADD . /src
WORKDIR /src
RUN make build
FROM docker.io/alpine:3.19@sha256:c5b1261d6d3e43071626931fc004f70149baeba2c8ec672bd4f27761f8e1ad6b
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.title="wp-opentofu"
LABEL org.opencontainers.image.url="https://github.com/thegeeklab/wp-opentofu"
LABEL org.opencontainers.image.source="https://github.com/thegeeklab/wp-opentofu"
LABEL org.opencontainers.image.documentation="https://github.com/thegeeklab/wp-opentofu"
ARG TARGETOS
ARG TARGETARCH
ARG TOFU_VERSION
# renovate: datasource=github-releases depName=opentofu/opentofu
ENV TOFU_VERSION="${TOFU_VERSION:-v1.6.2}"
RUN apk --update add --virtual .build-deps libarchive-tools && \
apk add --no-cache curl git openssh-client && \
curl -SsfL "https://github.com/opentofu/opentofu/releases/download/${TOFU_VERSION}/tofu_${TOFU_VERSION##v}_linux_amd64.zip" | \
bsdtar -xf - -C /usr/local/bin tofu && \
chmod 755 /usr/local/bin/tofu && \
apk del .build-deps && \
rm -rf /var/cache/apk/* && \
rm -rf /tmp/* && \
rm -rf /root/.cache/
COPY --from=build /src/dist/wp-opentofu /bin/wp-opentofu
ENTRYPOINT ["/bin/wp-opentofu"]