-
Notifications
You must be signed in to change notification settings - Fork 137
/
Dockerfile
40 lines (33 loc) · 1.44 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
FROM debian:bullseye
ARG ANSIBLE_CORE_VERSION
ARG ANSIBLE_VERSION
ARG ANSIBLE_LINT
ENV ANSIBLE_CORE_VERSION ${ANSIBLE_CORE_VERSION}
ENV ANSIBLE_VERSION ${ANSIBLE_VERSION}
ENV ANSIBLE_LINT ${ANSIBLE_LINT}
# Labels.
LABEL maintainer="will@willhallonline.co.uk" \
org.label-schema.schema-version="1.0" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.name="willhallonline/ansible" \
org.label-schema.description="Ansible inside Docker" \
org.label-schema.url="https://github.com/willhallonline/docker-ansible" \
org.label-schema.vcs-url="https://github.com/willhallonline/docker-ansible" \
org.label-schema.vendor="Will Hall Online" \
org.label-schema.docker.cmd="docker run --rm -it -v $(pwd):/ansible -v ~/.ssh/id_rsa:/root/id_rsa willhallonline/ansible:2.12-bullseye"
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get install -y python3-pip sshpass git openssh-client libhdf5-dev libssl-dev libffi-dev && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean
RUN pip3 install --upgrade pip cffi && \
pip3 install ansible-core==${ANSIBLE_CORE_VERSION} && \
pip3 install ansible==${ANSIBLE_VERSION} ansible-lint==${ANSIBLE_LINT} && \
pip3 install mitogen jmespath && \
pip install --upgrade pywinrm && \
rm -rf /root/.cache/pip
RUN mkdir /ansible && \
mkdir -p /etc/ansible && \
echo 'localhost' > /etc/ansible/hosts
WORKDIR /ansible
CMD [ "ansible-playbook", "--version" ]