Skip to content

Commit

Permalink
customize and see if this entrypoint works swell
Browse files Browse the repository at this point in the history
  • Loading branch information
Macleykun authored Feb 1, 2025
1 parent 0e2465c commit b9ac6ef
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 66 deletions.
18 changes: 0 additions & 18 deletions .github/release.yml

This file was deleted.

6 changes: 0 additions & 6 deletions .github/renovate.json

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/container.yml

This file was deleted.

18 changes: 9 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,22 @@ FROM python:alpine
WORKDIR /runner/

# Add non-root user
ARG USER=ansible
ARG GROUP=ansible
ARG UID=1000
ARG GID=1000
ARG USER=ansible && \
GROUP=ansible && \
UID=1000 && \
GID=1000
RUN addgroup ${GROUP} --gid ${GID} && \
adduser ${USER} --uid ${UID} \
--ingroup "${GROUP}" \
--disabled-password && \
chown ${USER}:${GROUP} /runner/

RUN chmod 777 /runner/ /home/ansible/
chown ${USER}:${GROUP} /runner/ /home/"${USER}"/

# Add requirements
COPY requirements/apk.list requirements/pip.list requirements/ansible.yaml /requirements/

RUN apk add --update --no-cache $(cat /requirements/apk.list) && \
ln -s /usr/local/bin/python3 /usr/bin/python3 && \
pip install --upgrade --no-cache-dir $(grep ansible-core /requirements/pip.list)
pip install --upgrade --no-cache-dir $(grep ansible-core /requirements/pip.list) # Needed for ansible-navigator

# Copy python environment (Ansible required args and scripts)
ENV PATH=/opt/ansible_venv/bin:${PATH} \
Expand All @@ -57,7 +55,9 @@ FROM python:alpine
--requirements-file /requirements/ansible.yaml --collections-path "/usr/share/ansible/collections" && \
chmod -R a=rX /usr/share/ansible

ENV HOME=/home/ansible
ENV HOME=/home/"${USER}"

# Switch to non-root user
USER ${UID}:${GID}

ENTRYPOINT ["ansible --version && pip list && ansible-galaxy collection list && ansible-galaxy role list"]
5 changes: 4 additions & 1 deletion requirements/ansible.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
collections:
- name: community.general
- name: ansible.windows
- name: containers.podman
- name: ansible.posix
# - name: community.mysql
# - name: community.crypto
7 changes: 2 additions & 5 deletions requirements/pip.list
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
ansible-core==2.18.1
ansible-runner
dnspython
pypsrp
requests
ansible-core
ansible-runner

0 comments on commit b9ac6ef

Please sign in to comment.