-
Notifications
You must be signed in to change notification settings - Fork 253
/
Copy pathDockerfile
47 lines (37 loc) · 1.09 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
FROM docker.io/library/python:3.10-slim-buster
ARG ansible_version
ARG ansible_lint_version
ENV ansible_version=5.8.0
ENV ansible_lint_version=6.6.1
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
# group 999 is needed for docker in docker
RUN groupadd -g 999 docker && useradd -m -u 1000 -G 999 ansible
RUN apt-get update -y &&\
apt-get install -y \
curl \
net-tools \
iputils-ping \
lsb-release \
openssh-client \
sshpass \
socat \
git \
tar \
unzip \
jq \
less
RUN python3 -m pip install --upgrade pip
RUN pip3 install ansible===${ansible_version} ansible-lint===${ansible_lint_version} && \
apt-get clean autoclean && \
apt-get autoremove --yes && \
rm -rf /var/lib/{apt,dpkg,cache,log}/ && \
rm -rf /root/.local /root/.cache && \
mkdir /git && chown ansible /git
USER root
# Please add following ENV to docker for Ansible
# ANSIBLE_COLLECTIONS_PATHS=/ansible/galaxy
RUN mkdir -p /ansible/galaxy && chown ansible /ansible/galaxy
USER ansible