Skip to content
This repository was archived by the owner on Feb 11, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Available Tags:
| `latest-base` | libffi-dev, libicu-dev, build-essential, libssl-dev, ca-certificates, jq, sed, grep, git, curl, wget, zip | Base runner with nothing fancy installed <br> [Dockerfile](images/base/Dockerfile) |
| `latest-kaniko-sidecar` | kaniko | Sidecar used by other runner images to build containers without root privileges |
| `latest-ansible-k8s` | base-image + ansible, helm, kubectl, skopeo | Runner specialized for automated k8s deployments via ansible <br> For more Details see [Dockerfile](images/ansible-k8s/Dockerfile) |
| `latest-fullstacked` | base-image + ansible, helm, maven, openjdk-11, nodejs, go, yarn, angular/cli | Runner with a bunch of tools to build your hole application<br> For more Details see [Dockerfile](images/fullstacked/Dockerfile) |
| `latest-fullstacked` | base-image + ansible, helm, maven, temurin-11, nodejs, go, yarn, angular/cli, chromium | Runner with a bunch of tools to build your hole application<br> For more Details see [Dockerfile](images/fullstacked/Dockerfile) |

> Hint: `latest` can be replaced with an specific release version for more stability in your environment.

Expand Down
26 changes: 20 additions & 6 deletions images/fullstacked/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
FROM ghcr.io/fullstack-devops/github-actions-runner:base-latest
FROM ghcr.io/fullstack-devops/github-actions-runner:latest-base

USER root
# install packages along with jq so we can parse JSON
# add additional packages as necessary
ARG PACKAGES="temurin-11-jdk maven nodejs ansible"
ARG PACKAGES="temurin-11-jdk maven nodejs ansible chromium python3-selenium xvfb"
ARG PACKAGES_PYTHON="kubernetes"

## ansible keys
RUN wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | apt-key add -
RUN echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list

## helper for karma and chromium
ENV CHROME_BIN="/usr/bin/chromium"
ADD xvfb-chromium /usr/bin/xvfb-chromium
ADD xvfb-chromium-webgl /usr/bin/xvfb-chromium-webgl
ADD display-chromium /usr/bin/display-chromium

RUN chmod +x /usr/bin/display-chromium /usr/bin/xvfb-chromium-webgl /usr/bin/xvfb-chromium

RUN apt-get update \
&& add-apt-repository -y --update ppa:ansible/ansible \
&& add-apt-repository -y --update ppa:xtradeb/apps \
&& curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \
&& apt-get install -y --no-install-recommends ${PACKAGES} \
&& rm -rf /var/lib/apt/lists/* \
Expand All @@ -37,20 +47,24 @@ RUN export ARCH=$(/helper-scripts/translate-aarch.sh a-short) \

ENV TMP_DIR=/home/${USERNAME}/tmp

RUN mkdir /run/user/$USERID
RUN mkdir /home/${USERNAME}/.ansible
RUN mkdir ${TMP_DIR}

COPY requirements.yml ${TMP_DIR}/requirements.yml

RUN mkdir -p /home/${USERNAME}/.m2/ \
&& chown -R ${USERNAME} /home/${USERNAME}
&& chown -R $USERNAME /home/$USERNAME \
&& chown -R $USERNAME /run/user/$USERID

# install npm tools: yarn
RUN npm install --global yarn @angular/cli@13
ENV NPM_CONFIG_LOGLEVEL=warn NG_CLI_ANALYTICS=false
RUN npm install --location=global yarn pnpm @angular/cli@14 \
&& npm cache clean --force

USER ${USERNAME}
USER $USERNAME

RUN pip3 install ${PACKAGES_PYTHON} --user
RUN pip3 install $PACKAGES_PYTHON --user

# RUN ansible-galaxy install -c -r ${TMP_DIR}/requirements.yml
RUN ansible-galaxy collection install -c -r ${TMP_DIR}/requirements.yml
Expand Down
3 changes: 3 additions & 0 deletions images/fullstacked/display-chromium
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

$CHROME_BIN --disable-dev-shm-usage --no-sandbox --no-first-run $@
23 changes: 23 additions & 0 deletions images/fullstacked/xvfb-chromium
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

find_free_servernum() {
i=0
while [ -f /tmp/.X$i-lock ]; do
i=$(($i + 1))
done
echo $i
}

export DISPLAY=":$(find_free_servernum)"
Xvfb "$DISPLAY" -ac -screen 0 "${XVFB_WHD:-1280x720x16}" -nolisten tcp +render &
xvfb_pid=$!

echo "(wrapper:) launching with: $@"

function cleanup {
kill -TERM $xvfb_pid > /dev/null 2>&1
}

trap cleanup EXIT

$CHROME_BIN --disable-dev-shm-usage --no-sandbox --disable-gpu --no-first-run $@
21 changes: 21 additions & 0 deletions images/fullstacked/xvfb-chromium-webgl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

find_free_servernum() {
i=0
while [ -f /tmp/.X$i-lock ]; do
i=$(($i + 1))
done
echo $i
}

export DISPLAY=":$(find_free_servernum)"
Xvfb "$DISPLAY" -ac -screen 0 "${XVFB_WHD:-1280x800x16}" -nolisten tcp +render &
xvfb_pid=$!

function cleanup {
kill -TERM $xvfb_pid > /dev/null 2>&1
}

trap cleanup EXIT

$CHROME_BIN --no-sandbox --no-first-run --use-gl=osmesa --enable-webgl --ignore-gpu-blacklist --window-size=1024,768 $@