From fe7d3ac2271d1a5a0788cdf2c3da697867816a70 Mon Sep 17 00:00:00 2001 From: Mirco Date: Wed, 24 May 2023 11:42:11 +0200 Subject: [PATCH] [skip-ci] Define ENV vars and COPY PATH ../docker/root --- .../docker-federated/image/Dockerfile | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/infrastructure/docker-federated/image/Dockerfile b/infrastructure/docker-federated/image/Dockerfile index ace4fb6..4dc288c 100644 --- a/infrastructure/docker-federated/image/Dockerfile +++ b/infrastructure/docker-federated/image/Dockerfile @@ -1,29 +1,30 @@ #Build stage -FROM docker.io/library/golang:1.20-alpine3.17 AS build-env +FROM docker.io/library/golang:1.20.4-alpine3.18 AS build-env ARG GOPROXY ENV GOPROXY ${GOPROXY:-direct} -ARG GITEA_VERSION +#ARG GITEA_VERSION ARG TAGS="sqlite sqlite_unlock_notify" ENV TAGS "bindata timetzdata $TAGS" ARG CGO_EXTRA_CFLAGS -ARG FORGEJO_GIT_URL="https://codeberg.org/forgejo/forgejo.git" -ARG FORGEJO_BRANCH="forgejo-federation" -ARG FORGEJO_FOLDER="forgejo-fed" +ENV FORGEJO_GIT_URL "https://codeberg.org/forgejo/forgejo.git" +ENV FORGEJO_BRANCH "forgejo-federation" +#ENV FORGEJO_FOLDER "forgejo-fed" #Build deps RUN apk --no-cache add build-base git nodejs npm #Setup repo -RUN git clone --single-branch --branch FORGEJO_BRANCH FORGEJO_GIT_URL FORGEJO_FOLDER -COPY FORGEJO_FOLDER/* ${GOPATH}/src/code.gitea.io/gitea +RUN git clone --single-branch --branch ${FORGEJO_BRANCH} ${FORGEJO_GIT_URL} ${GOPATH}/src/code.gitea.io/gitea +#${FORGEJO_FOLDER} +#COPY ${FORGEJO_FOLDER} ${GOPATH}/src/code.gitea.io/gitea WORKDIR ${GOPATH}/src/code.gitea.io/gitea #Checkout version if set -RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \ - && make clean-all build +#RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \ +RUN make clean-all build # Begin env-to-ini build RUN go build contrib/environment-to-ini/environment-to-ini.go @@ -67,7 +68,7 @@ VOLUME ["/data"] ENTRYPOINT ["/usr/bin/entrypoint"] CMD ["/bin/s6-svscan", "/etc/s6"] -COPY docker/root / +COPY --from=build-env /go/src/code.gitea.io/gitea/docker/root / COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea COPY --from=build-env /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh