forked from atlassian-api/atlassian-python-api
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.qa
71 lines (58 loc) · 2.4 KB
/
Dockerfile.qa
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
FROM ubuntu:20.04
ARG DEBIAN_FRONTEND=noninteractive
ARG PYTHON_VERSION
# Install add-apt-repository
RUN apt-get update
RUN apt install -y software-properties-common
# Add python repo
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update
# Install apt-utils
RUN apt install -y apt-utils
# install setuptools
RUN if [ $PYTHON_VERSION = '2.7' ] ; then \
apt install -y python-setuptools -reinstall ;\
else \
apt install -y python3-setuptools ;\
fi
# Install python development
RUN apt install -y \
python$PYTHON_VERSION-dev \
python3-pip
# install distutils.util
RUN if [ $PYTHON_VERSION = '3.7' ] ; then \
apt install -y python$PYTHON_VERSION-distutils python3-distutils-extra python3-apt --reinstall ;\
elif [ $PYTHON_VERSION = '3.6' ] ; then \
apt install -y python$PYTHON_VERSION-distutils python3-distutils-extra python3-apt --reinstall ;\
elif [ $PYTHON_VERSION = '3.10' ] ; then \
apt install -y python$PYTHON_VERSION-distutils python3-distutils-extra python3-apt --reinstall ; \
curl -sS https://bootstrap.pypa.io/get-pip.py | python$PYTHON_VERSION ; \
elif [ $PYTHON_VERSION = '3.11' ] ; then \
apt install -y python$PYTHON_VERSION-distutils python3-distutils-extra python3-apt --reinstall ; \
curl -sS https://bootstrap.pypa.io/get-pip.py | python$PYTHON_VERSION ; \
elif [ $PYTHON_VERSION = '3.12' ] ; then \
apt install -y python$PYTHON_VERSION-distutils python3-distutils-extra python3-apt --reinstall ; \
curl -sS https://bootstrap.pypa.io/get-pip.py | python$PYTHON_VERSION ; \
else \
apt install -y python3-distutils python3-distutils-extra python3-apt --reinstall ; \
fi
# Register the version in alternatives
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python$PYTHON_VERSION 1
# Install kerberos development
RUN apt install -y libkrb5-dev
# Clean
RUN apt-get clean
# Install modules
WORKDIR /atlassian-python-api
COPY requirements.txt .
COPY requirements-dev.txt .
RUN python3 -m pip install --no-cache-dir --upgrade setuptools
RUN python3 -m pip install --no-cache-dir --upgrade pip
RUN python3 -m pip install --no-cache-dir --upgrade wheel
RUN python3 -m pip install --no-cache-dir -r requirements-dev.txt
ENV PYTHON_VERSION=$PYTHON_VERSION
# Select language-agnostic "C" locale.
# Unicode is necessary for some tools like "black" to work.
ENV LC_ALL=C.UTF-8 LANG=C.UTF-8
CMD python3 -m pip install -e . && \
make qa PYTHON_VERSION=$PYTHON_VERSION