forked from ansible/molecule
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
67 lines (53 loc) · 1.34 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# This is a multi-stage build which requires Docker 17.05 or higher
FROM python:3.7-alpine as molecule-builder
WORKDIR /usr/src/molecule
ENV PACKAGES="\
gcc \
git \
libffi-dev \
make \
musl-dev \
openssl-dev \
"
RUN apk add --update --no-cache ${PACKAGES}
ENV MOLECULE_EXTRAS="azure,docker,docs,ec2,gce,linode,lxc,openstack,vagrant,windows"
ADD . .
RUN \
pip wheel \
-w dist \
".[${MOLECULE_EXTRAS}]"
# ✄---------------------------------------------------------------------
# This is an actual target container:
FROM python:3.7-alpine
LABEL maintainer "Ansible <[email protected]>"
ENV PACKAGES="\
docker \
openssh-client \
ruby \
"
ENV BUILD_DEPS="\
gcc \
libc-dev \
make \
ruby-dev \
ruby-rdoc \
"
ENV PIP_INSTALL_ARGS="\
--only-binary :all: \
--no-index \
-f /usr/src/molecule/dist \
"
ENV GEM_PACKAGES="\
rubocop \
"
ENV MOLECULE_EXTRAS="azure,docker,docs,ec2,gce,linode,lxc,openstack,vagrant,windows"
COPY --from=molecule-builder \
/usr/src/molecule/dist \
/usr/src/molecule/dist
RUN \
apk add --update --no-cache ${BUILD_DEPS} ${PACKAGES} && \
pip install ${PIP_INSTALL_ARGS} "molecule[${MOLECULE_EXTRAS}]" && \
gem install ${GEM_PACKAGES} && \
apk del --no-cache ${BUILD_DEPS} && \
rm -rf /root/.cache
ENV SHELL /bin/bash