-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
71 lines (59 loc) · 1.75 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
FROM alpine:3.16.6
# Metadata params
ARG BUILD_DATE
ARG ANSIBLE_VERSION
ARG ANSIBLE_LINT_VERSION
ARG MITOGEN_VERSION
ARG VCS_REF
# Metadata
LABEL maintainer="Emanoel Lopes <[email protected]>" \
org.label-schema.url="https://github.com/emanoelopes/ansible-labs/README.md" \
org.label-schema.build-date=${BUILD_DATE} \
org.label-schema.version=${ANSIBLE_VERSION} \
org.label-schema.vcs-url="https://github.com/emanoelopes/ansible-labs.git" \
org.label-schema.vcs-ref=${VCS_REF} \
org.label-schema.docker.dockerfile="/Dockerfile" \
org.label-schema.description="Ansible on alpine docker image" \
org.label-schema.schema-version="0.1"
RUN apk --update --no-cache add \
ca-certificates \
openssl \
python3 \
py3-pip \
py3-cryptography \
sshpass \
openssh-client \
rsync \
git
RUN apk --update add --virtual \
.build-deps \
python3-dev \
libffi-dev \
openssl-dev \
build-base \
&& pip3 install --upgrade \
pip \
cffi \
pywinrm[credssp] \
&& pip3 install \
ansible \
&& apk del \
.build-deps \
&& rm -rf /var/cache/apk/*
RUN mkdir -p /etc/ansible \
&& echo 'localhost' > /etc/ansible/hosts \
&& echo -e """\
\n\
Host *\n\
StrictHostKeyChecking no\n\
UserKnownHostsFile=/dev/null\n\
""" >> /etc/ssh/ssh_config
ADD . /ansible-labs
VOLUME /home/emanoel/ansible-labs /ansible-labs
#COPY entrypoint /usr/local/bin/
WORKDIR /ansible-labs
#ENTRYPOINT ["entrypoint"]
# Install Geerling Guy's Ansible Galalxy Collection for macOS hosts
CMD ["ansible-galaxy collection install geerlingguy.mac"]
# default command: display Ansible version
CMD [ "ansible-playbook", "--version" ]