From 62cc6421ea5b2df0e6f444ce5d353574413cab45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Mon, 16 Jan 2023 00:00:28 +0100 Subject: [PATCH] add google chrome and brave. --- .docker/brave/Dockerfile.nvidia | 23 ++++ .docker/brave/supervisord.nvidia.conf | 49 ++++++++ .docker/google-chrome/Dockerfile.nvidia | 21 ++++ .docker/google-chrome/supervisord.nvidia.conf | 50 ++++++++ .github/workflows/ghcr-nvidia.yml | 118 ++++++++++++++++++ 5 files changed, 261 insertions(+) create mode 100644 .docker/brave/Dockerfile.nvidia create mode 100644 .docker/brave/supervisord.nvidia.conf create mode 100644 .docker/google-chrome/Dockerfile.nvidia create mode 100644 .docker/google-chrome/supervisord.nvidia.conf create mode 100644 .github/workflows/ghcr-nvidia.yml diff --git a/.docker/brave/Dockerfile.nvidia b/.docker/brave/Dockerfile.nvidia new file mode 100644 index 00000000..0ac80280 --- /dev/null +++ b/.docker/brave/Dockerfile.nvidia @@ -0,0 +1,23 @@ +ARG BASE_IMAGE=m1k1o/neko:nvidia-base +FROM $BASE_IMAGE + +RUN set -eux; apt-get update; \ + apt-get install -y --no-install-recommends apt-transport-https curl openbox; \ + # + # install brave browser + curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg; \ + echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main" \ + | tee /etc/apt/sources.list.d/brave-browser-release.list; \ + apt-get update; \ + apt-get install -y --no-install-recommends brave-browser; \ + # + # clean up + apt-get clean -y; \ + rm -rf /var/lib/apt/lists/* /var/cache/apt/* + +# +# copy configuation files +COPY supervisord.nvidia.conf /etc/neko/supervisord/brave.conf +COPY --chown=neko preferences.json /home/neko/.config/brave/Default/Preferences +COPY policies.json /etc/brave/policies/managed/policies.json +COPY openbox.xml /etc/neko/openbox.xml diff --git a/.docker/brave/supervisord.nvidia.conf b/.docker/brave/supervisord.nvidia.conf new file mode 100644 index 00000000..8aebfd52 --- /dev/null +++ b/.docker/brave/supervisord.nvidia.conf @@ -0,0 +1,49 @@ +[program:brave] +environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s" +command=/bin/entrypoint.sh /usr/bin/brave-browser + --window-position=0,0 + --display=%(ENV_DISPLAY)s + --user-data-dir=/home/neko/.config/brave + --no-first-run + --start-maximized + --bwsi + --force-dark-mode + --disable-file-system + --disable-software-rasterizer + --disable-frame-rate-limit + --disable-gpu-driver-bug-workarounds + --disable-gpu-driver-workarounds + --disable-gpu-vsync + --enable-accelerated-2d-canvas + --enable-accelerated-video-decode + --enable-accelerated-mjpeg-decode + --enable-unsafe-webgpu + --enable-features=Vulkan,UseSkiaRenderer,VaapiVideoEncoder,VaapiVideoDecoder,CanvasOopRasterization + --disable-features=UseOzonePlatform,UseChromeOSDirectVideoDecoder + --enable-gpu-compositing + --enable-native-gpu-memory-buffers + --enable-gpu-rasterization + --enable-oop-rasterization + --enable-raw-draw + --enable-zero-copy + --ignore-gpu-blocklist + --use-gl=egl +stopsignal=INT +autorestart=true +priority=800 +user=%(ENV_USER)s +stdout_logfile=/var/log/neko/brave.log +stdout_logfile_maxbytes=100MB +stdout_logfile_backups=10 +redirect_stderr=true + +[program:openbox] +environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s" +command=/usr/bin/openbox --config-file /etc/neko/openbox.xml +autorestart=true +priority=300 +user=%(ENV_USER)s +stdout_logfile=/var/log/neko/openbox.log +stdout_logfile_maxbytes=100MB +stdout_logfile_backups=10 +redirect_stderr=true diff --git a/.docker/google-chrome/Dockerfile.nvidia b/.docker/google-chrome/Dockerfile.nvidia new file mode 100644 index 00000000..e1d15220 --- /dev/null +++ b/.docker/google-chrome/Dockerfile.nvidia @@ -0,0 +1,21 @@ +ARG BASE_IMAGE=m1k1o/neko:nvidia-base +FROM $BASE_IMAGE + +ARG SRC_URL="https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" + +# +# install google chrome +RUN set -eux; apt-get update; \ + wget -O /tmp/google-chrome.deb "${SRC_URL}"; \ + apt-get install -y --no-install-recommends openbox /tmp/google-chrome.deb; \ + # + # clean up + apt-get clean -y; \ + rm -rf /var/lib/apt/lists/* /var/cache/apt/* + +# +# copy configuation files +COPY supervisord.nvidia.conf /etc/neko/supervisord/google-chrome.conf +COPY --chown=neko preferences.json /home/neko/.config/google-chrome/Default/Preferences +COPY policies.json /etc/opt/chrome/policies/managed/policies.json +COPY openbox.xml /etc/neko/openbox.xml diff --git a/.docker/google-chrome/supervisord.nvidia.conf b/.docker/google-chrome/supervisord.nvidia.conf new file mode 100644 index 00000000..4a369cab --- /dev/null +++ b/.docker/google-chrome/supervisord.nvidia.conf @@ -0,0 +1,50 @@ +[program:google-chrome] +environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s" +command=/bin/entrypoint.sh /usr/bin/google-chrome + --window-position=0,0 + --display=%(ENV_DISPLAY)s + --user-data-dir=/home/neko/.config/google-chrome + --no-first-run + --start-maximized + --bwsi + --force-dark-mode + --disable-file-system + --disable-software-rasterizer + --disable-frame-rate-limit + --disable-gpu-driver-bug-workarounds + --disable-gpu-driver-workarounds + --disable-gpu-vsync + --enable-accelerated-2d-canvas + --enable-accelerated-video-decode + --enable-accelerated-mjpeg-decode + --enable-unsafe-webgpu + --enable-features=Vulkan,UseSkiaRenderer,VaapiVideoEncoder,VaapiVideoDecoder,CanvasOopRasterization + --disable-features=UseOzonePlatform,UseChromeOSDirectVideoDecoder + --enable-gpu-compositing + --enable-native-gpu-memory-buffers + --enable-gpu-rasterization + --enable-oop-rasterization + --enable-raw-draw + --enable-zero-copy + --ignore-gpu-blocklist + --use-gl=egl +stopsignal=INT +autorestart=true +priority=800 +user=%(ENV_USER)s +stdout_logfile=/var/log/neko/google-chrome.log +stdout_logfile_maxbytes=100MB +stdout_logfile_backups=10 +redirect_stderr=true + +[program:openbox] +environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s" +command=/usr/bin/openbox + --config-file /etc/neko/openbox.xml +autorestart=true +priority=300 +user=%(ENV_USER)s +stdout_logfile=/var/log/neko/openbox.log +stdout_logfile_maxbytes=100MB +stdout_logfile_backups=10 +redirect_stderr=true diff --git a/.github/workflows/ghcr-nvidia.yml b/.github/workflows/ghcr-nvidia.yml new file mode 100644 index 00000000..d5ad37e0 --- /dev/null +++ b/.github/workflows/ghcr-nvidia.yml @@ -0,0 +1,118 @@ +name: "nvidia gpu supported images" + +on: + push: + tags: + - 'v*' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: m1k1o/neko + TAG_PREFIX: nvidia- + BASE_DOCKERFILE: Dockerfile.nvidia + PLATFORMS: linux/amd64 + +jobs: + build-base: + runs-on: ubuntu-latest + # + # do not run on forks + # + if: github.repository_owner == 'm1k1o' + steps: + - + name: Checkout + uses: actions/checkout@v2 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Extract metadata (tags, labels) for Docker + uses: docker/metadata-action@v3 + id: meta + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ env.TAG_PREFIX }}base + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha,format=long + - + name: Log in to the Container registry + uses: docker/login-action@v1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GHCR_ACCESS_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v2 + with: + context: ./ + file: .docker/base/${{ env.BASE_DOCKERFILE }} + platforms: ${{ env.PLATFORMS }} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + build: + runs-on: ubuntu-latest + # + # do not run on forks + # + if: github.repository_owner == 'm1k1o' + needs: [ build-base ] + strategy: + # Will build all images even if some fail. + matrix: + include: + - tag: brave + dockerfile: Dockerfile.nvidia + - tag: google-chrome + dockerfile: Dockerfile.nvidia + env: + TAG_NAME: ${{ matrix.tag }} + DOCKERFILE: ${{ matrix.dockerfile }} + steps: + - + name: Checkout + uses: actions/checkout@v2 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Extract metadata (tags, labels) for Docker + uses: docker/metadata-action@v3 + id: meta + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ env.TAG_PREFIX }}${{ env.TAG_NAME }} + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha,format=long + - + name: Log in to the Container registry + uses: docker/login-action@v1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GHCR_ACCESS_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v2 + with: + context: .docker/${{ env.TAG_NAME }} + file: .docker/${{ env.TAG_NAME }}/${{ env.DOCKERFILE }} + platforms: ${{ env.PLATFORMS }} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + BASE_IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ env.TAG_PREFIX }}base:sha-${{ github.sha }}