forgejo/Dockerfile.ci

84 lines
1.7 KiB
Docker
Raw Normal View History

2022-12-04 21:46:35 +00:00
FROM alpine:3.17.0 as prep
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
2022-12-05 02:32:18 +00:00
ARG CACHEBUST=1
2022-12-05 19:05:13 +00:00
RUN apk --no-cache add bash && \
2022-12-05 00:54:28 +00:00
mkdir -p /docker/bin && \
2022-12-05 19:05:13 +00:00
mkdir /dist
2022-12-05 00:36:52 +00:00
2022-12-04 21:46:35 +00:00
ENV USER git
2022-12-05 00:36:52 +00:00
ARG DEFAULTTAGNAME
ARG CI_COMMIT_TAG
ENV DEFAULTTAGNAME=${DEFAULTTAGNAME:-main}
2022-12-05 01:21:57 +00:00
COPY docker /docker/
COPY dist /dist/
2022-12-05 00:36:52 +00:00
2022-12-05 02:32:18 +00:00
ARG CACHEBUST=1
2022-12-05 19:05:13 +00:00
RUN /docker/map-binaries.sh /dist/binaries forgejo ${CI_COMMIT_TAG##v} && \
/docker/map-binaries.sh /dist/contrib environment-to-ini ${CI_COMMIT_TAG##v}
2022-12-04 21:46:35 +00:00
2022-12-05 00:36:52 +00:00
RUN chmod 755 /docker/root/usr/bin/entrypoint /docker/root/etc/s6/gitea/* /docker/root/etc/s6/openssh/* /docker/root/etc/s6/.s6-svscan/* && \
find /docker/bin -name 'forgejo' -type f | xargs -I{} /bin/chmod 0755 {} && \
find /docker/bin -name 'environment-to-ini' -type f | xargs -I{} /bin/chmod 0755 {}
2022-12-04 21:46:35 +00:00
2022-12-04 20:28:30 +00:00
FROM alpine:3.17.0
2022-12-04 14:50:37 +00:00
LABEL maintainer="contact@forgejo.org"
ARG TARGETPLATFORM
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
EXPOSE 22 3000
#regrouped as updates to it should happen less frequently
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 apk --no-cache add \
bash \
ca-certificates \
curl \
gettext \
git \
linux-pam \
openssh \
s6 \
sqlite \
su-exec \
gnupg \
tzdata
ENV USER git
ENV GITEA_CUSTOM /data/gitea
VOLUME ["/data"]
ENTRYPOINT ["/usr/bin/entrypoint"]
CMD ["/bin/s6-svscan", "/etc/s6"]
2022-12-05 00:36:52 +00:00
COPY --from=prep /docker/root /
COPY --from=prep /docker/bin/$TARGETPLATFORM/forgejo /app/gitea/gitea
COPY --from=prep /docker/bin/$TARGETPLATFORM/environment-to-ini /usr/local/bin/environment-to-ini