-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
46 lines (44 loc) · 1.13 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 PYTHON_VERSION
FROM python:${PYTHON_VERSION}-alpine AS linter-base
RUN apk add --no-cache shadow
# UID of current user who runs the build
ARG user_id
# GID of current user who runs the build
ARG group_id
# HOME of current user who runs the build
ARG home
# change GID for dialout group which collides with MacOS staff GID (20) and
# create group and user to match permmisions of current who runs the build
ARG workdir
WORKDIR ${workdir}
RUN groupmod -g 64 dialout \
&& addgroup -S \
-g "${group_id}" \
union \
&& groupmod -g 2999 ping \
&& mkdir -p "${home}" \
&& adduser -S \
-u "${user_id}" \
-h "${home}" \
-s "/bin/bash" \
-G union \
builder \
&& chown -R builder:union "${workdir}"
FROM linter-base AS pipenv
ARG PIP_PIPENV_VERSION
RUN apk add --no-cache \
bash \
gcc \
libc-dev \
make \
curl \
git \
graphviz \
ttf-liberation \
&& pip install pipenv==${PIP_PIPENV_VERSION}
USER builder
# Install Python dependencies so they are cached
ARG workdir
WORKDIR ${workdir}
COPY --chown=builder:union Pipfile Pipfile.lock ./
RUN pipenv install --ignore-pipfile --dev