forked from Netcracker/KubeMarine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (28 loc) · 1.15 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
FROM python:3-slim-buster
ARG BUILD_TYPE
ENV PYTHONUNBUFFERED 1
# Used in Ansible plugin. See Ansible documentation for more details
ENV ANSIBLE_HOST_KEY_CHECKING False
COPY . /opt/kubemarine/
WORKDIR /opt/kubemarine/
RUN apt update && \
pip3 install --no-cache-dir build && \
python3 -m build -n && \
# In any if branch delete source code, but preserve specific directories for different service aims
if [ "$BUILD_TYPE" = "test" ]; then \
# Install from wheel with ansible to simulate real environment.
pip3 install --no-cache-dir $(ls dist/*.whl)[ansible]; \
find -not -path "./test*" -not -path "./examples*" -delete; \
elif [ "$BUILD_TYPE" = "package" ]; then \
find -not -path "./dist*" -delete; \
else \
pip3 install --no-cache-dir $(ls dist/*.whl)[ansible]; \
apt install -y wget; \
wget -O - https://get.helm.sh/helm-v3.10.0-linux-amd64.tar.gz | tar xvz -C /usr/local/bin linux-amd64/helm --strip-components 1; \
apt autoremove -y wget; \
rm -r *; \
fi && \
apt clean autoclean && \
rm -f /etc/apt/sources.list && \
rm -rf /var/lib/apt/lists/*
ENTRYPOINT ["kubemarine"]