-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
89 lines (73 loc) · 2.07 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
82
83
84
85
86
87
88
89
FROM nexus3.onap.org:10001/onap/integration-python:12.0.0 as build
# https://nexus3.onap.org/#browse/search=keyword%3Dintegration-python:d406d405e4cfbf1186265b01088caf9a
# https://git.onap.org/integration/docker/onap-python/tree/Dockerfile
USER root
RUN apk add --no-cache \
git \
curl \
bluez-dev \
bzip2-dev \
dpkg-dev dpkg \
expat-dev \
gcc \
libc-dev \
libffi-dev \
libnsl-dev \
libtirpc-dev \
linux-headers \
make \
ncurses-dev \
openssl-dev \
pax-utils \
sqlite-dev \
tcl-dev \
tk \
tk-dev \
util-linux-dev \
xz-dev \
zlib-dev \
&& curl -O https://get.helm.sh/helm-v3.3.1-linux-amd64.tar.gz \
&& tar -zxvf helm-v3.3.1-linux-amd64.tar.gz \
&& cp linux-amd64/helm /usr/local/bin \
&& rm -f helm-v3.3.1-linux-amd64.tar.gz
COPY requirements.txt /tmp/
COPY requirements-stx.txt /tmp/
COPY constraints.txt /tmp/
COPY setup.py /src/
ENV PATH="/.venv/bin:${PATH}"
RUN mkdir -p /.venv && \
python -m venv /.venv \
&& pip install --no-cache-dir -r /tmp/requirements.txt -r /tmp/requirements-stx.txt -c /tmp/constraints.txt \
&& pip install --no-cache-dir -e /src
FROM nexus3.onap.org:10001/onap/integration-python:12.0.0
ARG user=orano2
ARG group=orano2
USER root
RUN apk add --no-cache bash
COPY --from=build /.venv /.venv
COPY --from=build /src /src
# Create a group and user
RUN addgroup -S $group \
&& adduser -S -D -h /home/$user $user $group \
&& chown -R $user:$group /home/$user \
&& mkdir /var/log/$user \
&& mkdir -p /src \
&& mkdir -p /configs/ \
&& mkdir -p /src/o2app/ \
&& mkdir -p /src/helm_sdk/ \
&& mkdir -p /etc/o2/ \
&& chown -R $user:$group /var/log/$user \
&& chown -R $user:$group /src \
&& chown -R $user:$group /configs \
&& chown -R $user:$group /etc/o2/
COPY helm_sdk/ /src/helm_sdk/
COPY configs/ /etc/o2/
COPY configs/ /configs/
COPY o2common/ /src/o2common/
COPY o2app/ /src/o2app/
COPY o2dms/ /src/o2dms/
COPY o2ims/ /src/o2ims/
WORKDIR /src
# USER $user
ENV PYTHONHASHSEED=0
ENV PATH="/.venv/bin:${PATH}"