-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaster.Dockerfile
55 lines (48 loc) · 2.14 KB
/
master.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
# Copyright (C) 2024 Catalyst Cloud Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Ubuntu 22.04 with Python 3.10.
FROM ubuntu:22.04
ARG DISTIL_REPOSITORY="https://github.com/catalyst-cloud/distil.git"
ARG DISTIL_VERSION="master"
ARG UPPER_CONSTRAINTS_URL="https://releases.openstack.org/constraints/upper/master"
ARG UID="1000"
ARG GID="1000"
ENV LANG=C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
ENV PATH="/opt/distil/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin"
# netbase is required for the Python socket package to work.
# libssl is required for HTTPS support in uWSGI.
# git is required to pull git repositories using pip.
# build-essential and libpython3-dev are required to compile some binary wheels from source.
RUN apt-get update && \
apt-get install -y python3 \
python3-pip \
python3-virtualenv \
netbase \
libpython3.10 \
libssl3 \
git \
build-essential \
libpython3-dev \
libssl-dev && \
python3 -m virtualenv /opt/distil && \
/opt/distil/bin/python -m pip install --no-cache-dir \
-c "${UPPER_CONSTRAINTS_URL}" \
"distil @ git+${DISTIL_REPOSITORY}@${DISTIL_VERSION}" \
uwsgi && \
apt-get purge --auto-remove -y git build-essential libpython3-dev libssl-dev && \
groupadd --gid "${GID}" distil && \
useradd --uid "${UID}" --gid "${GID}" --shell /bin/bash distil
USER distil:distil