forked from ansible/molecule
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
147 lines (134 loc) · 2.83 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# This is a multi-stage build which requires Docker 17.05 or higher
FROM alpine:edge as molecule-builder
WORKDIR /usr/src/molecule
ENV PACKAGES="\
gcc \
git \
libffi-dev \
make \
musl-dev \
openssl-dev \
ansible \
ansible-lint \
docker-py \
py3-arrow \
py3-bcrypt \
py3-botocore \
py3-certifi \
py3-cffi \
py3-chardet \
py3-click \
py3-colorama \
py3-cryptography \
py3-docutils \
py3-flake8 \
py3-idna \
py3-jinja2 \
py3-mccabe \
py3-netifaces \
py3-paramiko \
py3-pbr \
py3-pexpect \
py3-pluggy \
py3-psutil \
py3-ptyprocess \
py3-py \
py3-pycodestyle \
py3-pynacl \
py3-pytest \
py3-requests \
py3-ruamel \
py3-setuptools \
py3-six \
py3-tabulate \
py3-urllib3 \
py3-virtualenv \
py3-websocket-client \
python3 \
python3-dev \
"
RUN apk add --update --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ ${PACKAGES}
ENV MOLECULE_EXTRAS="docker,docs,windows,lint"
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=917006
RUN pip3 install -U wheel
ADD . .
RUN \
pip3 wheel \
-w dist --no-build-isolation \
".[${MOLECULE_EXTRAS}]" testinfra
RUN ls -1 dist/
# ✄---------------------------------------------------------------------
# This is an actual target container:
FROM alpine:edge
LABEL maintainer "Ansible <[email protected]>"
ENV PACKAGES="\
docker \
git \
openssh-client \
ruby \
ansible \
ansible-lint \
docker-py \
py3-arrow \
py3-bcrypt \
py3-botocore \
py3-certifi \
py3-cffi \
py3-chardet \
py3-click \
py3-colorama \
py3-cryptography \
py3-docutils \
py3-flake8 \
py3-idna \
py3-jinja2 \
py3-mccabe \
py3-netifaces \
py3-paramiko \
py3-pbr \
py3-pexpect \
py3-pluggy \
py3-psutil \
py3-ptyprocess \
py3-py \
py3-pycodestyle \
py3-pynacl \
py3-pytest \
py3-requests \
py3-ruamel \
py3-setuptools \
py3-six \
py3-tabulate \
py3-urllib3 \
py3-virtualenv \
py3-websocket-client \
python3 \
"
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 \
json \
etc \
"
ENV MOLECULE_EXTRAS="docker,docs,windows"
RUN \
apk add --update --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ ${BUILD_DEPS} ${PACKAGES} \
gem install ${GEM_PACKAGES} \
apk del --no-cache ${BUILD_DEPS} \
rm -rf /root/.cache
COPY --from=molecule-builder \
/usr/src/molecule/dist \
/usr/src/molecule/dist
RUN pip3 install ${PIP_INSTALL_ARGS} "molecule[${MOLECULE_EXTRAS}]"
ENV SHELL /bin/bash