
Add logos for our cloud donors, similar to the https://openinfra.dev/members/#infrastructure or https://www.openstack.org/community/supporting-organizations/#infra-donors lists. Companies whose logos are listed on the OpenInfra members page have given explicit permission to the foundation to display those logos in order to promote their involvement in foundation-led activities, which includes projects and communities represented by the foundation (like the OpenDev Collaboratory). The agreements the companies referenced in this change have entered into aren't limited to specific web sites, so displaying them on opendev.org shouldn't require that we seek additional permission in order to do so. When adding these logos in a subdirectory (for ease of maintenance), we need to update the copy step from the assets image to the gitea image making it recursive, otherwise the directory will be omitted form the final image build. It's also worth noting that COPY directives in Dockerfiles behave in an odd and non-shell-like manner, as they flatten the files when recursing source directories, so you end up needing to force them into the intended target directories. Change-Id: I56279da7008cd4961c964b00f23a255e2865b602
136 lines
4.6 KiB
Docker
136 lines
4.6 KiB
Docker
# syntax=docker/dockerfile:1.3
|
|
# Copyright (c) 2018 Red Hat, Inc.
|
|
# Copyright (c) 2016 The Gitea Authors
|
|
# Copyright (c) 2015 The Gogs Authors
|
|
#
|
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
# of this software and associated documentation files (the "Software"), to deal
|
|
# in the Software without restriction, including without limitation the rights
|
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
# copies of the Software, and to permit persons to whom the Software is
|
|
# furnished to do so, subject to the following conditions:
|
|
#
|
|
# The above copyright notice and this permission notice shall be included in
|
|
# all copies or substantial portions of the Software.
|
|
#
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
# THE SOFTWARE.
|
|
|
|
# Tue Nov 1 17:14:38 UTC 2022 - trigger rebuild
|
|
|
|
###################################
|
|
#Build stage
|
|
FROM docker.io/library/golang:1.18-bullseye AS build-env
|
|
|
|
LABEL maintainer="infra-root@openstack.org"
|
|
|
|
ARG GITEA_VERSION="v1.17.3"
|
|
ENV TAGS "bindata $TAGS"
|
|
|
|
#Build deps
|
|
RUN apt-get update && apt-get -y install build-essential git apt-transport-https curl gnupg2 \
|
|
&& curl -sS https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
|
|
&& echo "deb https://deb.nodesource.com/node_16.x bullseye main" | tee /etc/apt/sources.list.d/nodesource.list \
|
|
&& 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
|
|
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
|
|
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
|
|
&& make clean-all build
|
|
|
|
# This is a utility the upstream image builds to translate env vars into
|
|
# the app.ini config. We primarily rely on ansible for this instead but
|
|
# 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
|
|
|
|
###################################
|
|
# Basic system setup common to all containers in our pod
|
|
|
|
FROM docker.io/library/debian:bullseye-slim as base
|
|
|
|
RUN apt-get update && apt-get -y install \
|
|
bash \
|
|
ca-certificates \
|
|
curl \
|
|
gettext \
|
|
git \
|
|
openssh-client \
|
|
tzdata \
|
|
gnupg \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN addgroup --system --gid 1000 git \
|
|
&& adduser \
|
|
--system --no-create-home --disabled-login \
|
|
--home /data/git \
|
|
--shell /bin/bash \
|
|
--uid 1000 \
|
|
--gid 1000 \
|
|
git \
|
|
&& echo "git:$(dd if=/dev/urandom bs=24 count=1 status=none | base64)" | chpasswd \
|
|
&& mkdir /custom
|
|
|
|
# Copy the /etc config files and entrypoint script
|
|
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 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/
|
|
|
|
ENV GITEA_CUSTOM /custom
|
|
|
|
###################################
|
|
# The gitea image
|
|
FROM base as gitea
|
|
|
|
RUN apt-get update && apt-get -y install pandoc \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
EXPOSE 3000
|
|
ENV USER git
|
|
VOLUME ["/data"]
|
|
ENTRYPOINT ["/usr/bin/entrypoint"]
|
|
CMD ["/usr/local/bin/gitea", "web"]
|
|
USER 1000:1000
|
|
|
|
###################################
|
|
# The openssh server image
|
|
FROM base as gitea-openssh
|
|
|
|
RUN apt-get update \
|
|
&& DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confold" \
|
|
install openssh-server \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
&& mkdir /run/sshd
|
|
|
|
COPY sshd-entrypoint.sh /usr/bin/entrypoint
|
|
|
|
EXPOSE 22
|
|
VOLUME ["/data"]
|
|
ENTRYPOINT ["/usr/bin/entrypoint"]
|
|
CMD ["/usr/sbin/sshd", "-D", "-e"]
|