-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
52 lines (45 loc) · 1.31 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
FROM python:3.13-bookworm
LABEL org.opencontainers.image.title="Ansible Runner"
LABEL org.opencontainers.image.description="Ansible Run Container"
LABEL org.opencontainers.image.vendor="Gamers Outreach Foundation"
LABEL org.opencontainers.image.source="https://github.com/gamersoutreach/docker-ansible-runner"
LABEL org.opencontainers.image.licenses="MIT"
ENV PYTHONUNBUFFERED=1 \
LANG="C.UTF-8" \
LANGUAGE="C.UTF-8" \
LC_ALL="C.UTF-8" \
LC_CTYPE="C.UTF-8"
# Create app directory
RUN set -eux; \
mkdir /app
# Create ansible user with explicit uid
RUN <<EOF
set -eux
groupadd -r ansible --gid=1000
useradd -m -u 1000 -g 1000 ansible
mkdir -p /home/ansible/.ssh
chown -R ansible:ansible /home/ansible
EOF
# Install system runtime dependencies
RUN <<EOF
set -eux
apt-get update
apt-get install -y --no-install-recommends \
gosu \
libssh-dev \
sshpass
rm -rf /var/lib/apt/lists/*
EOF
# Install python runtime dependencies
COPY overlay/ /
RUN <<EOF
set -eux
chown -R ansible:ansible /home/ansible
pip install -r /opt/buildpack/requirements.txt
su -c "ansible-galaxy collection install -r /opt/buildpack/requirements.yaml" ansible
EOF
VOLUME /app
VOLUME /home/ansible/.ssh
WORKDIR /app
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["/bin/bash"]