-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
67 lines (52 loc) · 1.41 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
# Redistributable base image from Red Hat based on RHEL 8
#
FROM registry.access.redhat.com/ubi8/ubi
#
# Metadata information
#
LABEL name="Gogs UBI Image" \
vendor="Gogs" \
maintainer="Davi Garcia <[email protected]>" \
build-date="2020-03-24" \
version="${GOGS_VERSION}" \
release="2"
#
# Environment variables used for build/exec
#
ENV GOGS_VERSION=0.11.91 \
GOGS_USER=gogs \
GOGS_WEB_PORT=3000 \
GOGS_SSH_PORT=3022 \
GOGS_BASEDIR=/opt \
GOGS_WORKDIR=/opt/gogs \
GOGS_DATADIR=/opt/gogs/data \
GOGS_HOMEDIR=/home/gogs \
YUM_OPTS="--setopt=install_weak_deps=False --setopt=tsflags=nodocs"
#
# Copy helper scripts to image
#
COPY helpers/* /usr/bin/
#
# Install requirements and application
#
RUN yum ${YUM_OPTS} -y install git nss_wrapper && \
yum -y clean all && \
cd ${GOGS_BASEDIR} && \
curl -L https://dl.gogs.io/${GOGS_VERSION}/gogs_${GOGS_VERSION}_linux_amd64.tar.gz | tar -xz && \
mkdir ${GOGS_DATADIR} && \
cd ${GOGS_WORKDIR}
#
# Prepare the image for running on OpenShift
#
RUN useradd -m -g 0 ${GOGS_USER} && \
chgrp -R 0 ${GOGS_HOMEDIR} ${GOGS_WORKDIR} ${GOGS_DATADIR} && \
chmod -R g+rwX ${GOGS_HOMEDIR} ${GOGS_WORKDIR} ${GOGS_DATADIR}
USER ${GOGS_USER}
#
# Set application execution parameters
#
EXPOSE ${GOGS_WEB_PORT} ${GOGS_SSH_PORT}
WORKDIR ${GOGS_WORKDIR}
ENTRYPOINT ["/usr/bin/entrypoint.sh"]
CMD ["run-gogs"]