forked from OWASP/cornucopia
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (38 loc) · 1.11 KB
/
Dockerfile
File metadata and controls
42 lines (38 loc) · 1.11 KB
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
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
FROM linter-base AS pipenv
RUN apk add --no-cache \
bash \
curl \
docker \
gcc \
git \
libc-dev \
make \
&& pip install --upgrade pip
RUN pip install --upgrade pipenv
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
ENTRYPOINT [ "/usr/local/bin/pipenv" ]
FROM mvdan/shfmt AS shfmt
ENTRYPOINT [ "/bin/shfmt" ]