diff --git a/.forgejo/workflows/build-container.yml b/.forgejo/workflows/build-container.yml new file mode 100644 index 0000000..8659c8e --- /dev/null +++ b/.forgejo/workflows/build-container.yml @@ -0,0 +1,33 @@ +name: build-container + +on: + push: + branches: + - 'main' + +jobs: + docker: + runs-on: pi + container: + image: python:3.12.2-slim-bookworm + steps: + - name: Install dependencies + id: dependencies + run: | + apt-get update + apt-get install -y -qq nodejs git + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: false + tags: scm.project42.io/elia/ansible-actions-container:latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b1bd366 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM python:3.12.2-slim-bookworm + +RUN apt-get update && \ + apt-get install -y -qq nodejs git && \ + apt-get clean && \ + useradd -m --uid 1010 --shell /bin/bash ansible + +USER 1010 + +RUN pip install --user ansible && \ + echo 'export PATH="$HOME/.local/bin:$PATH"' >> $HOME/.bashrc + +ENTRYPOINT ["/bin/bash"]