-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (34 loc) · 1.61 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
FROM python:3.10-alpine3.17 AS builder
ENV MOLECULE_VER=4.0.3
RUN set -eux \
&& apk add --update --no-cache \
gcc \
libc-dev \
libffi-dev \
make \
musl-dev \
openssl-dev \
&& pip install --no-cache-dir \
cryptography==3.4.8 \
ansible-lint \
jmespath \
"molecule[ansible,docker,lint]==$MOLECULE_VER" \
yamllint
FROM python:3.9-alpine3.13
LABEL "maintainer"="Michal Muransky <[email protected]>"
LABEL "repository"="https://github.com/MonolithProjects/action-molecule"
LABEL "com.github.actions.icon"="play-circle"
LABEL "com.github.actions.color"="gray-dark"
LABEL "com.github.actions.name"="action-molecule"
LABEL "com.github.actions.description"="Molecule for Ansible"
RUN set -eux \
&& apk add --update --no-cache \
docker \
git \
openssh-client \
&& rm -rf /root/.cache
COPY --from=builder /usr/local/lib/python3.10/site-packages/ /usr/local/lib/python3.10/site-packages/
COPY --from=builder /usr/local/bin/molecule /usr/local/bin/molecule
COPY --from=builder /usr/local/bin/yamllint /usr/local/bin/yamllint
COPY --from=builder /usr/local/bin/ansible* /usr/local/bin/
CMD cd ${GITHUB_REPOSITORY} ; if [ "${M_COMMAND}" = "converge" ] && [ -n "${EXTRA_ARGS}" ] ; then echo "Ansible extra arguments: ${EXTRA_ARGS}" ; ASSEMBLED_CMD="molecule converge -s ${SCENARIO:-default} -- ${EXTRA_ARGS}" ; eval $ASSEMBLED_CMD; else molecule "${M_COMMAND}" -s ${SCENARIO:-default} ; fi