From 3ffcf7be7a4cb61acd0d40e0f669fc598b611730 Mon Sep 17 00:00:00 2001 From: "henrik.meyer.cap" Date: Tue, 9 Apr 2024 14:05:46 +0200 Subject: [PATCH] Build and push container image for docops --- .github/workflows/docopstoghcr-on-push.yaml | 21 +++++++++++++ docops/Dockerfile | 34 +++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 .github/workflows/docopstoghcr-on-push.yaml create mode 100644 docops/Dockerfile diff --git a/.github/workflows/docopstoghcr-on-push.yaml b/.github/workflows/docopstoghcr-on-push.yaml new file mode 100644 index 0000000..cf58637 --- /dev/null +++ b/.github/workflows/docopstoghcr-on-push.yaml @@ -0,0 +1,21 @@ +--- +name: docops Docker Image on Push to GHCR + +on: + push: + branches-ignore: + - master + paths: + - 'docops/**' + +jobs: + build_image_on_push: + permissions: + packages: write + security-events: write + actions: read + contents: read + uses: ./.github/workflows/imagetoghcr-on-push.yaml + with: + image_name: "docops" + context: "./docops/" diff --git a/docops/Dockerfile b/docops/Dockerfile new file mode 100644 index 0000000..c65a4b2 --- /dev/null +++ b/docops/Dockerfile @@ -0,0 +1,34 @@ +FROM quay.io/ansible/awx-ee:24.1.0 + +USER root + +RUN \ + # Add non-privileged user + adduser docops --user-group && \ + # Install drawio + dnf install -y wget && \ + mkdir /home/docops/drawio && \ + cd /home/docops/drawio && \ + curl -s https://api.github.com/repos/jgraph/drawio-desktop/releases/latest | grep browser_download_url | grep '.*drawio-x86_64-.*\.rpm' | cut -d '"' -f 4 | wget -i - && \ + dnf install -y ./drawio-x86_64-*.rpm && \ + dnf remove -y wget && \ + rm -rf /home/docops/drawio && \ + # Install X Virtual Framebuffer as an X server because it's needed to execute drawio in a headless mode + # Later execute drawio with xvfb as the following. + # Remember to append the options '--disable-gpu --headless --no-sandbox' as the last options of the command. + # Examples: + # xvfb-run -a drawio --version --disable-gpu --headless --no-sandbox + # xvfb-run -a drawio --export --format png --output ./test.png ./test.drawio --disable-gpu --headless --no-sandbox + dnf install -y xorg-x11-server-Xvfb; + +USER docops + +RUN \ + # Install doctoolchain + cd /home/docops && \ + curl -Lo dtcw https://doctoolchain.org/dtcw && \ + chmod +x ./dtcw && \ + ./dtcw install doctoolchain; \ + ./dtcw install java; + +CMD ["/bin/bash"]