-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
121 lines (120 loc) · 3.02 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
# syntax=docker/dockerfile:1
#
ARG IMAGEBASE=frommakefile
#
FROM ${IMAGEBASE}
#
ARG MITOGEN_VERSION=0.3.13
#
ENV \
CRYPTOGRAPHY_DONT_BUILD_RUST=1 \
MITOGEN_DIR=/opt/mitogen \
MITOGEN_VERSION=${MITOGEN_VERSION}
#
RUN set -xe \
&& apk add --no-cache --purge -uU \
black \
ca-certificates \
curl \
libffi \
openssh \
openssl \
py3-bcrypt \
py3-certifi \
py3-cffi \
# py3-cryptography \
py3-lxml \
py3-markupsafe \
py3-pynacl \
py3-ruamel.yaml.clib \
py3-six \
py3-yaml \
&& apk add --update --virtual .build-dependencies \
build-base \
cython \
# # new cryptography requires rust to build
cargo \
libffi-dev \
linux-headers \
openssl-dev \
python3-dev \
&& pip3 install --no-cache-dir --break-system-packages --upgrade \
pip \
setuptools \
wheel \
&& pip3 install --no-cache-dir --break-system-packages \
# # needed packages
ansible \
ansible-lint \
molecule \
#
# # extra pip packages
# ansible-cmdb \
cryptography \
paramiko \
requests \
# # for json queries
jmespath \
# for facts-cache (optional)
redis \
#
# for dns
dnspython \
# # docker packages
docker \
# # docker-compose now deprecated, install docker-cli[-compose] at runtime instead
# docker-compose \
#
# for expect
pexpect \
ptyprocess \
# # hashicorp consul, vault, and nomad
pyhcl \
python-consul \
hvac \
python-nomad \
#
# # for windows hosts (remote)
pypsrp \
pywinrm \
#
# # pretty formatting
# yamlfmt \
# # python yamlfmt now deprecated
# # TODO: try google's instead (or prettier??)
# # fallback to yamlfix,
yamlfix \
# # optionals: add as needed at runtime via S6_PIP_PACKAGES or part of playbook
&& apk del --purge .build-dependencies \
# # extra packages
&& apk add --no-cache --purge -uU \
expect \
git \
make \
rsync \
sshpass \
sudo \
#
# # optionals: add at runtime via S6_NEEDED_PACKAGES or part of playbook
# docker-cli \
# docker-cli-compose \
#
&& mkdir -p \
/etc/ansible \
${MITOGEN_DIR} \
&& curl -jSLN \
-o /tmp/mitogen.tar.gz \
https://files.pythonhosted.org/packages/source/m/mitogen/mitogen-${MITOGEN_VERSION}.tar.gz \
&& tar xzf /tmp/mitogen.tar.gz -C ${MITOGEN_DIR} --strip-components=1 \
#
&& echo 'localhost' > /etc/ansible/hosts \
&& echo "${S6_USER:-alpine} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \
#
&& rm -rf /var/cache/apk/* /tmp/* /root/.cache /root/.cargo
#
# VOLUME /home/${S6_USER:-alpine}/ # bind mount on host
# WORKDIR /home/${S6_USER:-alpine}/
#
ENTRYPOINT ["/usershell"]
#
CMD ["ansible", "--version"]