Skip to content

Commit

Permalink
Build a dev image based on Chrome 117
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit74 committed Sep 21, 2023
1 parent df2403c commit edd07fc
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 34 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Docker dev

on:
push:
branches:
- dev-chrome-117

jobs:
build-and-push:
name: Deploy Docker Image
runs-on: ubuntu-22.04

steps:
- name: Retrieve source code
uses: actions/checkout@v3

- name: Build and push
uses: openzim/docker-publish-action@v10
with:
image-name: openzim/zimit
manual-tag: dev-chrome-117-bis
restrict-to: openzim/zimit
registries: ghcr.io
credentials:
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }}
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }}
repo_description: auto
repo_overview: auto
platforms: |
linux/amd64
35 changes: 1 addition & 34 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,2 @@
FROM webrecorder/browsertrix-crawler:v0.11.0
FROM ghcr.io/benoit74/zimit:dev-chrome-117
LABEL org.opencontainers.image.source https://github.com/openzim/zimit

RUN apt-get update \
&& apt-get install -qqy --no-install-recommends \
libmagic1 \
python3.10-venv \
&& rm -rf /var/lib/apt/lists/* \
# python setup (in venv not to conflict with browsertrix)
&& python3 -m venv /app/zimit \
&& /app/zimit/bin/python -m pip install --no-cache-dir 'requests==2.31.0' 'inotify==0.2.10' 'tld==0.13' 'warc2zim==1.5.4' \
# placeholder (default output location)
&& mkdir -p /output \
# disable chrome upgrade
&& printf "repo_add_once=\"false\"\nrepo_reenable_on_distupgrade=\"false\"\n" > /etc/default/google-chrome \
# download list of bad domains to filter-out. intentionnaly ran post-install \
# so it's not cached in earlier layers (url stays same but content updated) \
mkdir -p /tmp/ads && cd /tmp/ads && \
curl -L -O https://hosts.anudeep.me/mirror/adservers.txt && \
curl -L -O https://hosts.anudeep.me/mirror/CoinMiner.txt && \
curl -L -O https://hosts.anudeep.me/mirror/facebook.txt && \
cat ./*.txt > /etc/blocklist.txt \
&& rm ./*.txt \
&& printf '#!/bin/sh\ncat /etc/blocklist.txt >> /etc/hosts\nexec "$@"' > /usr/local/bin/entrypoint.sh && \
chmod +x /usr/local/bin/entrypoint.sh

WORKDIR /app
ADD zimit.py /app/
# fix shebang on zimit to use in-venv python
RUN sed -i.bak "1 s/.*/#!\/app\/zimit\/bin\/python3/" /app/zimit.py \
&& ln -s /app/zimit.py /usr/bin/zimit \
&& chmod +x /usr/bin/zimit

ENTRYPOINT ["entrypoint.sh"]
CMD ["zimit"]

0 comments on commit edd07fc

Please sign in to comment.