-
Notifications
You must be signed in to change notification settings - Fork 22
/
Dockerfile
46 lines (37 loc) · 1.47 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
FROM python:3.9.7-alpine3.14 AS builder
ARG BUILD_DEPS="\
docker=20.10.9-r0 \
gcc=10.3.1_git20210424-r2 \
libc-dev=0.7.2-r3 \
libffi-dev=3.3-r2 \
make=4.3-r0 \
musl-dev=1.2.2-r3 \
openssh-client=8.6_p1-r3 \
openssl-dev=1.1.1l-r0 \
"
RUN apk add --update --no-cache ${BUILD_DEPS}
COPY Pipfile* .
RUN pip install pipenv && \
pipenv install --deploy --system
FROM python:3.9.7-alpine3.14 AS runtime
LABEL "maintainer"="Eugene Vasilenko <gmrnsk@gmail.com>"
LABEL "repository"="https://github.com/gofrolist/molecule-action"
LABEL "com.github.actions.name"="molecule"
LABEL "com.github.actions.description"="Run Ansible Molecule"
LABEL "com.github.actions.icon"="upload"
LABEL "com.github.actions.color"="green"
COPY --from=builder /usr/local/lib/python3.9/site-packages/ /usr/local/lib/python3.9/site-packages/
COPY --from=builder /usr/local/bin/ansible* /usr/local/bin/
COPY --from=builder /usr/local/bin/flake8 /usr/local/bin/flake8
COPY --from=builder /usr/local/bin/molecule /usr/local/bin/molecule
COPY --from=builder /usr/local/bin/pytest /usr/local/bin/pytest
COPY --from=builder /usr/local/bin/yamllint /usr/local/bin/yamllint
ARG PACKAGES="\
docker=20.10.9-r0 \
git=2.32.0-r0 \
openssh-client=8.6_p1-r3 \
podman=3.2.3-r1 \
"
RUN apk add --update --no-cache ${PACKAGES} && \
rm -rf /root/.cache
CMD cd ${INPUT_MOLECULE_WORKING_DIR}; molecule ${INPUT_MOLECULE_OPTIONS} ${INPUT_MOLECULE_COMMAND} ${INPUT_MOLECULE_ARGS}