-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
46 lines (43 loc) · 1.3 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
ARG BASE_IMAGE_VERSION
FROM python:${BASE_IMAGE_VERSION}
ARG POETRY_VERSION
ENV PATH=/root/.local/bin:$PATH
RUN --mount=type=tmpfs,target=/root/.cargo --mount=type=bind,source=install.py,target=/install.py set -eux; \
if grep -q alpine /etc/os-release ; then \
apk add --no-cache --virtual .build-deps \
cargo \
g++ \
gcc \
libffi-dev \
linux-headers \
musl-dev \
openssl \
openssl-dev \
; \
POETRY_VERSION=$POETRY_VERSION python /install.py || cat /poetry-installer-error-*.log ; \
apk del --no-network .build-deps; \
else \
apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cargo \
g++ \
gcc \
libffi-dev \
libssl-dev \
pkg-config \
; \
POETRY_VERSION=$POETRY_VERSION python /install.py || cat /poetry-installer-error-*.log ; \
apt-get purge -y \
build-essential \
cargo \
g++ \
gcc \
libffi-dev \
libssl-dev \
pkg-config \
; \
apt-get autoremove -y ; \
rm -rf /var/lib/apt/lists/* ; \
fi ; \
poetry --version
CMD ["python3"]