ansible-bws/Dockerfile

39 lines
1.1 KiB
Text
Raw Permalink Normal View History

2025-01-13 01:51:25 -05:00
# Base image
2025-01-12 17:01:22 -05:00
FROM willhallonline/ansible:2.17-ubuntu-24.04
# Remove externally managed Python restriction
RUN rm -rf /usr/lib/python3.12/EXTERNALLY-MANAGED
# Install Python dependencies for Bitwarden and Docker
RUN pip install --no-cache-dir bitwarden-sdk
# Install Ansible collections
2025-01-13 01:51:25 -05:00
RUN ansible-galaxy collection install bitwarden.secrets \
&& ansible-galaxy collection install community.docker \
&& ansible-galaxy collection install community.general
2025-01-12 17:01:22 -05:00
# Install required packages and dependencies
2025-01-13 01:51:25 -05:00
RUN apt-get update && apt-get install -y --no-install-recommends \
2025-01-12 17:01:22 -05:00
libssl3 \
curl \
git \
nodejs \
2025-01-13 01:51:25 -05:00
&& apt-get clean && rm -rf /var/lib/apt/lists/*
2025-01-12 17:01:22 -05:00
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# Ensure Rust binaries are added to the PATH
ENV PATH="/root/.cargo/bin:${PATH}"
# Install the bws tool using Cargo
RUN cargo install bws
2025-01-13 01:51:25 -05:00
# Set PYTHONPATH for custom Python package locations
2025-01-12 17:01:22 -05:00
ENV PYTHONPATH=/usr/local/lib/python3.12/dist-packages:${PYTHONPATH}
2025-01-13 01:51:25 -05:00
# Set the working directory
2025-01-12 17:01:22 -05:00
WORKDIR /ansible
2025-01-13 01:51:25 -05:00
# Default command
2025-01-12 17:01:22 -05:00
CMD [ "ansible-playbook", "--version" ]