Skip to content

Instantly share code, notes, and snippets.

@SpikePy
Created January 8, 2025 19:23
Show Gist options
  • Save SpikePy/238f71ab2b2914c6d89b898a09078d83 to your computer and use it in GitHub Desktop.
Save SpikePy/238f71ab2b2914c6d89b898a09078d83 to your computer and use it in GitHub Desktop.
Dockerfile Ansible Alpine
FROM python:alpine
RUN apk add --no-cache --virtual .build-deps gcc make python3-dev linux-headers libgcc musl-dev
RUN pip install ansible-core
RUN ansible-galaxy collection install azure.azcollection community.general kubernetes.core
RUN pip install -r ~/.ansible/collections/ansible_collections/azure/azcollection/requirements-azure.txt
#RUN pip install azure-cli==$(grep azure-cli-core ~/.ansible/collections/ansible_collections/azure/azcollection/requirements-azure.txt | cut -d'=' -f3)
RUN apk del .build-deps
ENV ANSIBLE_STDOUT_CALLBACK=yaml
ENV PS1='[\u@ansible-azure-toolbox][\w] '
ENTRYPOINT ["/bin/ash"]
FROM python:slim
RUN pip install ansible-core
RUN ansible-galaxy collection install azure.azcollection community.general kubernetes.core
RUN pip install -r ~/.ansible/collections/ansible_collections/azure/azcollection/requirements-azure.txt
#RUN pip install azure-cli==$(grep azure-cli-core ~/.ansible/collections/ansible_collections/azure/azcollection/requirements-azure.txt | cut -d'=' -f3)
ENV ANSIBLE_STDOUT_CALLBACK=yaml
ENV PS1='[\u@ansible-azure-toolbox][\w] '
ENTRYPOINT ["/bin/bash"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment