diff --git a/docker/gitea/Dockerfile b/docker/gitea/Dockerfile index 7296ad3e2d..518af21408 100644 --- a/docker/gitea/Dockerfile +++ b/docker/gitea/Dockerfile @@ -24,15 +24,18 @@ # Wed Oct 11 15:53:34 UTC 2023 - trigger rebuild ################################### -#Build stage -FROM docker.io/library/golang:1.20-bookworm AS build-env +# Build stage +FROM docker.io/library/golang:1.21-bookworm AS build-env LABEL maintainer="infra-root@openstack.org" -ARG GITEA_VERSION="v1.20.6" -ENV TAGS "bindata $TAGS" +ARG GOPROXY +ENV GOPROXY ${GOPROXY:-direct} -#Build deps +ARG GITEA_VERSION="v1.21.3" +ENV TAGS "bindata timetzdata $TAGS" + +# Build deps RUN apt-get update \ && apt-get -y dist-upgrade \ && apt-get -y install build-essential git apt-transport-https curl gnupg2 \ @@ -42,11 +45,11 @@ RUN apt-get update \ && apt-get -q --option "Dpkg::Options::=--force-confold" --assume-yes install nodejs \ && mkdir -p ${GOPATH}/src/code.gitea.io/gitea -#Setup repo +# Setup repo RUN git clone https://github.com/go-gitea/gitea ${GOPATH}/src/code.gitea.io/gitea WORKDIR ${GOPATH}/src/code.gitea.io/gitea -#Checkout version if set +# Checkout version if set RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \ && make clean-all build @@ -55,11 +58,22 @@ RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \ # build an include it anyway to stay in sync with upstream tooling. RUN go build contrib/environment-to-ini/environment-to-ini.go -# Make things executable since they aren't all that way in git -RUN chmod 755 gitea \ - environment-to-ini \ - docker/root/usr/bin/entrypoint \ - docker/root/usr/local/bin/gitea +# TODO upstream performs this COPY then chmods the docker/root/ prefixed +# files below against /tmp/local. The copy fails for us due to some bad +# interaction with docker image build caching. I think due to how we clone +# the repo above. We should align better with upstream if possible. +## Copy local files +# COPY docker/root /tmp/local + +# Set permissions +RUN chmod 755 docker/root/usr/bin/entrypoint \ + docker/root/usr/local/bin/gitea \ + docker/root/etc/s6/gitea/* \ + docker/root/etc/s6/openssh/* \ + docker/root/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 ################################### # Basic system setup common to all containers in our pod @@ -75,7 +89,6 @@ RUN apt-get update \ gettext \ git \ openssh-client \ - tzdata \ gnupg \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* @@ -97,11 +110,12 @@ COPY --from=build-env /go/src/code.gitea.io/gitea/docker/root / # Copy the app 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 # Copy our custom templates and some additional image files COPY custom/ /custom/ # Copy our opendev logo contents to the custom location -RUN --mount=type=bind,from=opendevorg/assets,target=/tmp/assets cp -r /tmp/assets/* /custom/public/img/ +RUN --mount=type=bind,from=opendevorg/assets,target=/tmp/assets cp -r /tmp/assets/* /custom/public/assets/img/ ENV GITEA_CUSTOM /custom # This is used the the openssh container image to set sshd_config AllowUsers diff --git a/docker/gitea/custom/public/img/avatar_default.png b/docker/gitea/custom/public/assets/img/avatar_default.png similarity index 100% rename from docker/gitea/custom/public/img/avatar_default.png rename to docker/gitea/custom/public/assets/img/avatar_default.png diff --git a/docker/gitea/custom/public/img/etherpad.svg b/docker/gitea/custom/public/assets/img/etherpad.svg similarity index 100% rename from docker/gitea/custom/public/img/etherpad.svg rename to docker/gitea/custom/public/assets/img/etherpad.svg diff --git a/docker/gitea/custom/public/img/gerrit.svg b/docker/gitea/custom/public/assets/img/gerrit.svg similarity index 100% rename from docker/gitea/custom/public/img/gerrit.svg rename to docker/gitea/custom/public/assets/img/gerrit.svg diff --git a/docker/gitea/custom/public/img/git.svg b/docker/gitea/custom/public/assets/img/git.svg similarity index 100% rename from docker/gitea/custom/public/img/git.svg rename to docker/gitea/custom/public/assets/img/git.svg diff --git a/docker/gitea/custom/public/img/gitea-safari.svg b/docker/gitea/custom/public/assets/img/gitea-safari.svg similarity index 100% rename from docker/gitea/custom/public/img/gitea-safari.svg rename to docker/gitea/custom/public/assets/img/gitea-safari.svg diff --git a/docker/gitea/custom/public/img/zuul.svg b/docker/gitea/custom/public/assets/img/zuul.svg similarity index 100% rename from docker/gitea/custom/public/img/zuul.svg rename to docker/gitea/custom/public/assets/img/zuul.svg diff --git a/docker/gitea/custom/templates/base/head_navbar.tmpl b/docker/gitea/custom/templates/base/head_navbar.tmpl index c359f99b92..c7cef0d6c6 100644 --- a/docker/gitea/custom/templates/base/head_navbar.tmpl +++ b/docker/gitea/custom/templates/base/head_navbar.tmpl @@ -3,86 +3,86 @@ {{$notificationUnreadCount = call .NotificationUnreadCount}} {{end}} -