Update Dockerfile
This commit is contained in:
parent
9733c64f07
commit
67c3314b0d
1 changed files with 80 additions and 11 deletions
91
Dockerfile
91
Dockerfile
|
@ -1,17 +1,86 @@
|
||||||
ADD alpine-minirootfs-3.21.3-x86_64.tar.gz / # buildkit
|
# Build stage
|
||||||
CMD ["/bin/sh"]
|
FROM docker.io/library/golang:1.23-alpine3.21 AS build-env
|
||||||
|
|
||||||
EXPOSE map[22/tcp:{} 3000/tcp:{}]
|
ARG GOPROXY
|
||||||
|
ENV GOPROXY=${GOPROXY:-direct}
|
||||||
|
|
||||||
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 GITEA_VERSION
|
||||||
|
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 /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea # buildkit
|
COPY --from=build-env /tmp/local /
|
||||||
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/gitea /app/gitea/gitea
|
||||||
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/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
|
Loading…
Add table
Add a link
Reference in a new issue