-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
83 lines (65 loc) · 2.38 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
# Copyright IBM Inc. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
ARG base_image=ubuntu:22.04
FROM $base_image
# VV: Builder image
RUN apt-get update && \
export DEBIAN_FRONTEND=noninteractive && \
apt-get install -y \
python3.10 python3-pip python3-tk git python3-rdkit locales curl libffi-dev libssl-dev \
libpng-dev libjpeg-dev libfreetype6-dev pkg-config libxml2-dev libxslt-dev libpython3.10-dev \
libzmq3-dev
ENV LANGUAGE=en
ENV LC_ALL en_GB.UTF-8
ENV LANG en_GB.UTF-8
RUN locale-gen ${LC_ALL}
RUN python3 -m pip install --upgrade pip virtualenv setuptools six tox && \
python3 -m pip install papermill
RUN mkdir /venvs
ENV PIP_DEFAULT_TIMEOUT=120
COPY ./ st4sd-runtime-core
ENV VIRTUAL_ENV=/venvs/st4sd-runtime-core
RUN cd /st4sd-runtime-core && \
export DEPLOY_VENV=${VIRTUAL_ENV} && \
export TOX_ENV=py310-deploy && \
tox -e $TOX_ENV -vv && \
chmod a+rwx ${VIRTUAL_ENV}/* && \
chmod a+rwx ${VIRTUAL_ENV}/*/*/*
RUN PATH=${VIRTUAL_ENV}/bin:${PATH} pip3 install twine
RUN cd /st4sd-runtime-core && \
export PATH=${VIRTUAL_ENV}/bin:${PATH} && \
python3 setup.py sdist bdist_wheel
# VV: Runtime image
FROM $base_image
ENV LANGUAGE=en
ENV LC_ALL en_GB.UTF-8
ENV LANG en_GB.UTF-8
# VV: Install system-wide pip and python-tk for matplotlib for consistency with moved virtual-env
RUN apt-get update && \
apt-get upgrade -y && \
export DEBIAN_FRONTEND=noninteractive && \
apt-get install -y --no-install-recommends python3.10 python3-pip python3-tk libffi-dev python3-rdkit vim-tiny \
locales libzmq3-dev && \
locale-gen ${LC_ALL} && \
rm -rf /var/lib/apt/lists/*
RUN echo 'You can find the licenses of GPL packages in this container under \n\
/usr/share/doc/${PACKAGE_NAME}/copyright \n\
\n\
If you would like the source to the GPL packages in this image then \n\
send a request to this address, specifying the package you want and \n\
the name and hash of this image: \n\
\n\
IBM Research Ireland,\n\
IBM Technology Campus\n\
Damastown Industrial Park\n\
Mulhuddart Co. Dublin D15 HN66\n\
Ireland\n' >/gpl-licenses
ENV VIRTUAL_ENV=/venvs/st4sd-runtime-core
COPY --from=0 /venvs/ /venvs/
COPY --from=0 /st4sd-runtime-core/dist /st4sd-runtime-core/dist
# VV: Activate the virtual environment
ENV PIP_DEFAULT_TIMEOUT=120
ENV PATH=${VIRTUAL_ENV}/bin:${PATH}
RUN elaunch.py -h && \
elaunch.py --version
CMD elaunch.py -h