retest
ci/woodpecker/tag/compliance-and-tests Pipeline was successful Details
ci/woodpecker/tag/release-version Pipeline failed Details

minimal-dockerfile
gapodo 2022-12-07 23:11:11 +01:00
parent d132dbe58e
commit 9986443830
1 changed files with 11 additions and 4 deletions

View File

@ -2,17 +2,22 @@ FROM --platform=$BUILDPLATFORM golang:1.19 AS build-env
ARG BUILDPLATFORM
ARG GOPROXY
ENV GOPROXY ${GOPROXY:-direct}
ENV GOPROXY "${GOPROXY:-direct}"
ARG TAG
ENV TAG ${TAG:-main}
ARG CI_COMMIT_SHA
ENV CI_COMMIT_SHA "${CI_COMMIT_SHA}"
ARG CI_REPO_CLONE_URL
ENV CI_REPO_CLONE_URL "${CI_REPO_CLONE_URL}"
# Shorthands for easy use and ease of replacement
ARG OUT "/out-bins"
ENV OUT "${OUT}"
ARG DR "/docker/root"
ENV DR "${DR}"
# Check vars and create directories
RUN test -n "$CI_COMMIT_SHA" || (echo "CI_COMMIT_SHA is required but not set" >&2 && exit 1) && \
@ -56,9 +61,6 @@ RUN echo "setting up git" && \
FROM alpine:3.17.0
LABEL maintainer="contact@forgejo.org"
ARG TARGETPLATFORM
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
EXPOSE 22 3000
RUN apk --no-cache add \
@ -95,8 +97,13 @@ VOLUME ["/data"]
ENTRYPOINT ["/usr/bin/entrypoint"]
CMD ["/bin/s6-svscan", "/etc/s6"]
ARG TARGETPLATFORM
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
ARG OUT "/out-bins"
ENV OUT "${OUT}"
ARG DR "/docker/root"
ENV DR "${DR}"
COPY --from=build-env "${DR}" /
COPY --from=build-env --chmod=755 "${OUT}/$TARGETPLATFORM/*" /app/gitea/