-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.template
32 lines (25 loc) · 1.02 KB
/
Dockerfile.template
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
# Version 1.0 template-transformer-simple
FROM base-image
LABEL maintainer=""
COPY requirements.txt packages.txt /home/extractor/
USER root
RUN [ -s /home/extractor/packages.txt ] && \
(echo 'Installing packages' && \
apt-get update && \
cat /home/extractor/packages.txt | xargs apt-get install -y --no-install-recommends && \
rm /home/extractor/packages.txt && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*) || \
(echo 'No packages to install' && \
rm /home/extractor/packages.txt)
RUN [ -s /home/extractor/requirements.txt ] && \
(echo "Install python modules" && \
python3 -m pip install -U --no-cache-dir pip && \
python3 -m pip install --no-cache-dir setuptools && \
python3 -m pip install --no-cache-dir -r /home/extractor/requirements.txt && \
rm /home/extractor/requirements.txt) || \
(echo "No python modules to install" && \
rm /home/extractor/requirements.txt)
USER extractor
COPY *.py /home/extractor/