-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
81 lines (69 loc) · 1.91 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
FROM registry.fedoraproject.org/fedora:39
ARG GIT_URL=unknown
ARG GIT_COMMIT=unknown
LABEL description="Pipeline base image" \
summary="Pipeline base image" \
maintainer="Chuang Cao(CC)" \
vendor="Red Hat, Inc." \
distribution-scope="public" \
vcs-type="git" \
vcs-url=$GIT_URL \
vcs-ref=$GIT_COMMIT
ARG USER=tc
ARG UID=10000
ARG HOME_DIR=/home/tc
RUN useradd -d ${HOME_DIR} -u ${UID} -g 0 -m -s /bin/bash ${USER} \
&& chmod -R g+rwx ${HOME_DIR} \
# Make /etc/passwd writable for root group
# so we can add dynamic user to the system in entrypoint script
&& chmod g+rw /etc/passwd \
&& dnf install -y \
--setopt install_weak_deps=false \
--nodocs \
--disablerepo=* \
--enablerepo=fedora,updates \
git-core \
python3 \
python3-pip \
python3-attrs \
python3-click \
python3-retrying \
python3-requests \
python3-requests-kerberos \
python3-gssapi \
python3-jira \
python3-dateutil \
python3-jinja2 \
python3-graphviz \
python-unversioned-command \
krb5-devel \
krb5-workstation \
'dnf-command(config-manager)' \
gcc python3-devel \
krb5-devel \
openldap-devel \
shadow-utils \
yamllint \
krb5-workstation \
ansible \
go \
&& dnf clean all \
&& chmod og+r /etc/krb5.conf
ENV \
REQUESTS_CA_BUNDLE=/etc/pki/tls/certs/ca-bundle.crt \
HOME=${HOME_DIR} \
LANG=en_US.UTF-8 \
KRB5CCNAME=FILE:/tmp/ccache \
PIP_DEFAULT_TIMEOUT=100 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_NO_CACHE_DIR=1 \
PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1
COPY . .
RUN pip3 install --no-cache-dir -r ./requirements.txt
RUN go mod download
RUN go build -buildvcs=false -o ./main
ENV PORT 8088
EXPOSE 8088
USER ${UID}
ENTRYPOINT ["./main"]