2023-10-29 07:14:06 +05:30
|
|
|
# Build stage
|
2023-12-24 02:34:58 +05:30
|
|
|
FROM docker.io/library/golang:1.21-alpine3.19 AS build-env
|
2018-03-12 15:29:13 +05:30
|
|
|
|
2019-08-05 03:28:16 +05:30
|
|
|
ARG GOPROXY
|
|
|
|
ENV GOPROXY ${GOPROXY:-direct}
|
|
|
|
|
2018-03-12 15:29:13 +05:30
|
|
|
ARG GITEA_VERSION
|
2018-10-23 17:17:59 +05:30
|
|
|
ARG TAGS="sqlite sqlite_unlock_notify"
|
2020-09-28 04:22:22 +05:30
|
|
|
ENV TAGS "bindata timetzdata $TAGS"
|
2020-06-07 03:12:32 +05:30
|
|
|
ARG CGO_EXTRA_CFLAGS
|
2018-03-12 15:29:13 +05:30
|
|
|
|
2023-10-29 07:14:06 +05:30
|
|
|
# Build deps
|
|
|
|
RUN apk --no-cache add \
|
|
|
|
build-base \
|
|
|
|
git \
|
|
|
|
nodejs \
|
|
|
|
npm \
|
|
|
|
&& rm -rf /var/cache/apk/*
|
2018-03-12 15:29:13 +05:30
|
|
|
|
2023-10-29 07:14:06 +05:30
|
|
|
# Setup repo
|
2018-03-12 15:29:13 +05:30
|
|
|
COPY . ${GOPATH}/src/code.gitea.io/gitea
|
|
|
|
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
|
|
|
|
|
2023-10-29 07:14:06 +05:30
|
|
|
# Checkout version if set
|
2018-03-12 15:29:13 +05:30
|
|
|
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
|
2020-03-04 01:21:11 +05:30
|
|
|
&& make clean-all build
|
2018-03-12 15:29:13 +05:30
|
|
|
|
2021-02-24 00:51:44 +05:30
|
|
|
# Begin env-to-ini build
|
|
|
|
RUN go build contrib/environment-to-ini/environment-to-ini.go
|
|
|
|
|
2023-10-29 07:14:06 +05:30
|
|
|
# Copy local files
|
|
|
|
COPY docker/root /tmp/local
|
|
|
|
|
|
|
|
# Set permissions
|
|
|
|
RUN chmod 755 /tmp/local/usr/bin/entrypoint \
|
|
|
|
/tmp/local/usr/local/bin/gitea \
|
|
|
|
/tmp/local/etc/s6/gitea/* \
|
|
|
|
/tmp/local/etc/s6/openssh/* \
|
|
|
|
/tmp/local/etc/s6/.s6-svscan/* \
|
|
|
|
/go/src/code.gitea.io/gitea/gitea \
|
|
|
|
/go/src/code.gitea.io/gitea/environment-to-ini
|
|
|
|
RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete
|
|
|
|
|
2023-12-24 02:34:58 +05:30
|
|
|
FROM docker.io/library/alpine:3.19
|
2018-03-12 15:29:13 +05:30
|
|
|
LABEL maintainer="maintainers@gitea.io"
|
2015-08-25 10:11:01 +05:30
|
|
|
|
2016-11-28 18:43:18 +05:30
|
|
|
EXPOSE 22 3000
|
2015-08-25 10:11:01 +05:30
|
|
|
|
2017-05-08 16:39:20 +05:30
|
|
|
RUN apk --no-cache add \
|
2016-11-28 18:43:18 +05:30
|
|
|
bash \
|
2018-03-12 15:29:13 +05:30
|
|
|
ca-certificates \
|
|
|
|
curl \
|
|
|
|
gettext \
|
2016-11-28 18:43:18 +05:30
|
|
|
git \
|
|
|
|
linux-pam \
|
|
|
|
openssh \
|
2018-03-12 15:29:13 +05:30
|
|
|
s6 \
|
|
|
|
sqlite \
|
|
|
|
su-exec \
|
2023-10-29 07:14:06 +05:30
|
|
|
gnupg \
|
|
|
|
&& rm -rf /var/cache/apk/*
|
2018-03-12 15:29:13 +05:30
|
|
|
|
2017-06-30 11:40:37 +05:30
|
|
|
RUN addgroup \
|
2016-11-28 22:07:31 +05:30
|
|
|
-S -g 1000 \
|
2016-11-28 18:43:18 +05:30
|
|
|
git && \
|
2016-11-28 21:52:22 +05:30
|
|
|
adduser \
|
|
|
|
-S -H -D \
|
|
|
|
-h /data/git \
|
2016-11-28 18:43:18 +05:30
|
|
|
-s /bin/bash \
|
|
|
|
-u 1000 \
|
2016-11-28 21:52:22 +05:30
|
|
|
-G git \
|
2016-12-15 14:46:55 +05:30
|
|
|
git && \
|
2021-04-29 23:18:52 +05:30
|
|
|
echo "git:*" | chpasswd -e
|
2015-08-17 12:40:23 +05:30
|
|
|
|
2017-06-30 11:40:37 +05:30
|
|
|
ENV USER git
|
|
|
|
ENV GITEA_CUSTOM /data/gitea
|
2016-01-25 18:37:37 +05:30
|
|
|
|
2015-10-02 15:26:36 +05:30
|
|
|
VOLUME ["/data"]
|
2016-11-28 18:43:18 +05:30
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/bin/entrypoint"]
|
|
|
|
CMD ["/bin/s6-svscan", "/etc/s6"]
|
|
|
|
|
2023-10-29 07:14:06 +05:30
|
|
|
COPY --from=build-env /tmp/local /
|
2018-03-12 15:29:13 +05:30
|
|
|
COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
|
2021-02-24 00:51:44 +05:30
|
|
|
COPY --from=build-env /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini
|
2023-02-21 23:02:24 +05:30
|
|
|
COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh
|