Update Dockerfile
This commit is contained in:
parent
4858314496
commit
9733c64f07
1 changed files with 11 additions and 80 deletions
91
Dockerfile
91
Dockerfile
|
@ -1,86 +1,17 @@
|
||||||
# Build stage
|
ADD alpine-minirootfs-3.21.3-x86_64.tar.gz / # buildkit
|
||||||
FROM docker.io/library/golang:1.24-alpine3.21 AS build-env
|
CMD ["/bin/sh"]
|
||||||
|
|
||||||
ARG GOPROXY
|
EXPOSE map[22/tcp:{} 3000/tcp:{}]
|
||||||
ENV GOPROXY=${GOPROXY:-direct}
|
|
||||||
|
|
||||||
ARG GITEA_VERSION
|
RUN /bin/sh -c apk --no-cache add bash ca-certificates curl gettext git linux-pam openssh s6 sqlite su-exec gnupg && rm -rf /var/cache/apk/* # buildkit
|
||||||
ARG TAGS="sqlite sqlite_unlock_notify"
|
|
||||||
ENV TAGS="bindata timetzdata $TAGS"
|
|
||||||
ARG CGO_EXTRA_CFLAGS
|
|
||||||
|
|
||||||
# Build deps
|
|
||||||
RUN apk --no-cache add \
|
|
||||||
build-base \
|
|
||||||
git \
|
|
||||||
nodejs \
|
|
||||||
npm \
|
|
||||||
&& rm -rf /var/cache/apk/*
|
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
FROM docker.io/library/alpine:3.21
|
|
||||||
LABEL maintainer="maintainers@gitea.io"
|
|
||||||
|
|
||||||
EXPOSE 22 3000
|
|
||||||
|
|
||||||
RUN apk --no-cache add \
|
|
||||||
bash \
|
|
||||||
ca-certificates \
|
|
||||||
curl \
|
|
||||||
gettext \
|
|
||||||
git \
|
|
||||||
linux-pam \
|
|
||||||
openssh \
|
|
||||||
s6 \
|
|
||||||
sqlite \
|
|
||||||
su-exec \
|
|
||||||
gnupg \
|
|
||||||
&& rm -rf /var/cache/apk/*
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
|
RUN /bin/sh -c addgroup -S -g 1000 git && adduser -S -H -D -h /data/git -s /bin/bash -u 1000 -G git git && echo "git:*" | chpasswd -e # buildkit
|
||||||
ENV USER=git
|
ENV USER=git
|
||||||
ENV GITEA_CUSTOM=/data/gitea
|
ENV GITEA_CUSTOM=/data/gitea
|
||||||
|
VOLUME [/data]
|
||||||
VOLUME ["/data"]
|
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/bin/entrypoint"]
|
ENTRYPOINT ["/usr/bin/entrypoint"]
|
||||||
CMD ["/usr/bin/s6-svscan", "/etc/s6"]
|
CMD ["/usr/bin/s6-svscan" "/etc/s6"]
|
||||||
|
COPY /tmp/local / # buildkit
|
||||||
COPY --from=build-env /tmp/local /
|
COPY /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea # buildkit
|
||||||
COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
|
COPY /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini # buildkit
|
||||||
COPY --from=build-env /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini
|
COPY /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh # buildkit
|
||||||
COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh
|
|
Loading…
Add table
Add a link
Reference in a new issue