forgejo/Dockerfile

71 lines
1.7 KiB
Docker
Raw Normal View History

#Build stage
FROM docker.io/library/golang:1.20-alpine3.18 AS build-env
ARG GOPROXY
ENV GOPROXY ${GOPROXY:-direct}
ARG GITEA_VERSION
ARG TAGS="sqlite sqlite_unlock_notify"
2020-09-28 00:52:22 +02:00
ENV TAGS "bindata timetzdata $TAGS"
ARG CGO_EXTRA_CFLAGS
#Build deps
RUN apk --no-cache add build-base git nodejs npm
#Setup repo
COPY . ${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
# Begin env-to-ini build
RUN go build contrib/environment-to-ini/environment-to-ini.go
FROM docker.io/library/alpine:3.18
[CI] implementation: forgejo container images (cherry picked from commit dd1971d4e60f37fb76daeb6cef8b1defcc957a34) (cherry picked from commit 3981dbaf8c0dd74b0e82a7afc36809998ac775a2) (cherry picked from commit 8dff3cc2d1a51980439e9ca8f1cad592403c558e) (cherry picked from commit e7673e5d2237733e4e17b9386c4bb25bb88fe2e2) (cherry picked from commit 326174064ba6dbd379ea82e9643e23fe684ad96f) (cherry picked from commit eb769dbde4fb0d7a8a4bd74b6bcdf1f1f180f840) (cherry picked from commit 335829ade20a187c7fd423909231d198a59545bd) (cherry picked from commit 5e8e4f549d2224a00387764e93fdbde34e324c3d) Conflicts: Dockerfile Dockerfile.rootless (cherry picked from commit b777fc91d0ba5b1a061bd9cc57c4818a3357b42a) (cherry picked from commit 02cda642ec7ce2b69de7f0ff4fb4f0d70941f54e) (cherry picked from commit 96ef93f3bc1b618831f04e1ae5d5c7c74e2ed36c) (cherry picked from commit aa424551f24364dd43d9b7739b723bb1d914eeaf) Conflicts: Dockerfile Dockerfile.rootless (cherry picked from commit e54fa86e4904047e5670e68a9dd89e76530564a4) (cherry picked from commit 043fa6d6649272f14a65ee2c9cac15b090e66bc9) (cherry picked from commit 805b16248015e8d7ab8c4f514969cff333d432c8) (cherry picked from commit 86bf362a3c8386cc4530c0c4cba46097ed20d8af) (cherry picked from commit 13e0007959fb5e2496b3bbec916036bd2a05a558) (cherry picked from commit 00ff6f7cb3c54ae3a8ed2069b0dd0dddd98e7e6e) (cherry picked from commit 95c7d8e883da495facfbac39db55b5b710ea25a7) (cherry picked from commit fb033d2bb613c34b7f61c2bad14136f8f110081e) (cherry picked from commit 1147910a552db9fdf7f4ef0a35e9b1d2405b0e69)
2022-11-25 10:11:23 +01:00
LABEL maintainer="contact@forgejo.org"
2015-08-25 06:41:01 +02:00
EXPOSE 22 3000
2015-08-25 06:41:01 +02:00
RUN apk --no-cache add \
bash \
ca-certificates \
curl \
gettext \
git \
linux-pam \
openssh \
s6 \
sqlite \
su-exec \
gnupg
RUN addgroup \
-S -g 1000 \
git && \
adduser \
-S -H -D \
-h /data/git \
-s /bin/bash \
-u 1000 \
-G git \
git && \
echo "git:*" | chpasswd -e
2015-08-17 09:10:23 +02:00
ENV USER git
ENV GITEA_CUSTOM /data/gitea
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/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
RUN chmod 755 /usr/bin/entrypoint /app/gitea/gitea /usr/local/bin/gitea /usr/local/bin/environment-to-ini
RUN chmod 755 /etc/s6/gitea/* /etc/s6/openssh/* /etc/s6/.s6-svscan/*
RUN chmod 644 /etc/profile.d/gitea_bash_autocomplete.sh