neko/.docker/ungoogled-chromium/Dockerfile

58 lines
2.8 KiB
Docker
Raw Normal View History

2021-04-02 07:37:51 +13:00
ARG BASE_IMAGE=m1k1o/neko:base
FROM $BASE_IMAGE
2020-06-30 19:45:45 +12:00
ARG API_URL="https://api.github.com/repos/macchrome/linchrome/releases/latest"
2020-08-17 04:51:31 +12:00
2020-06-30 19:45:45 +12:00
#
# install custom chromium build from woolyss with support for hevc/x265
SHELL ["/bin/bash", "-c"]
2020-06-30 19:45:45 +12:00
RUN set -eux; apt-get update; \
2021-02-10 09:20:53 +13:00
apt-get install -y --no-install-recommends wget unzip libatk1.0-0 libatk-bridge2.0-0 libatomic1 \
libcups2 libgtk-3-0 libnss3 libpci3 libxcomposite1 libxss1 openbox xz-utils jq; \
#
# fetch latest release
2021-11-05 08:50:38 +13:00
SRC_URL="$(wget -O - "${API_URL}" 2>/dev/null | jq -r "[.assets[] | select(.browser_download_url | contains(\"tar.xz\"))][-1] | .browser_download_url")"; \
2020-08-17 04:51:31 +12:00
wget -O - /tmp/chromium.tar.xz "${SRC_URL}" | tar -xJf- -C /tmp; \
mv /tmp/ungoogled-chromium_* /usr/lib/chromium; \
2020-06-30 19:45:45 +12:00
#
# make required changes for sandbox mode
mv /usr/lib/chromium/chrome_sandbox /usr/lib/chromium/chrome-sandbox; \
chown root:root /usr/lib/chromium/chrome-sandbox; \
chmod 4755 /usr/lib/chromium/chrome-sandbox; \
2020-06-30 19:45:45 +12:00
#
2021-02-10 09:20:53 +13:00
# install widevine module
WIDEVINE_VERSION=$(wget --quiet -O - https://dl.google.com/widevine-cdm/versions.txt | tail -n 1); \
wget -O /tmp/widevine.zip "https://dl.google.com/widevine-cdm/${WIDEVINE_VERSION}-linux-x64.zip"; \
2021-02-10 09:20:53 +13:00
unzip -p /tmp/widevine.zip libwidevinecdm.so > /usr/lib/chromium/libwidevinecdm.so; \
chmod 644 /usr/lib/chromium/libwidevinecdm.so; \
rm /tmp/widevine.zip; \
#
# install latest version of uBlock Origin and SponsorBlock for YouTube
CHROMIUM_VERSION="$(wget -O - "${API_URL}" 2>/dev/null | jq -r ".tag_name" | sed -e 's/v//' -e 's/-.*//')"; \
EXTENSIONS_DIR="/usr/share/chromium/extensions"; \
EXTENSIONS=( \
cjpalhdlnbpafiamejdnhcphjbkeiagm \
mnjggcdmjocbbbhaepdhchncahnbgone \
fihnjjcciajhdojfnbdddfaoknhalnja \
); \
mkdir -p "${EXTENSIONS_DIR}"; \
for EXT_ID in "${EXTENSIONS[@]}"; \
do \
EXT_URL="https://clients2.google.com/service/update2/crx?response=redirect&nacl_arch=x86-64&prodversion=${CHROMIUM_VERSION}&acceptformat=crx2,crx3&x=id%3D${EXT_ID}%26installsource%3Dondemand%26uc"; \
EXT_PATH="${EXTENSIONS_DIR}/${EXT_ID}.crx"; \
wget -O "${EXT_PATH}" "${EXT_URL}"; \
EXT_VERSION="$(unzip -p "${EXT_PATH}" manifest.json 2>/dev/null | jq -r ".version")"; \
echo -e "{\n \"external_crx\": \"${EXT_PATH}\",\n \"external_version\": \"${EXT_VERSION}\"\n}" > "${EXTENSIONS_DIR}"/"${EXT_ID}".json; \
done; \
2020-06-30 19:45:45 +12:00
# clean up
apt-get --purge autoremove -y xz-utils jq; \
2020-06-30 19:45:45 +12:00
apt-get clean -y; \
rm -rf /var/lib/apt/lists/* /var/cache/apt/*
#
# copy configuation files
2021-04-02 07:00:59 +13:00
COPY supervisord.conf /etc/neko/supervisord/ungoogled-chromium.conf
COPY preferences.json /usr/lib/chromium/master_preferences
2020-06-30 19:45:45 +12:00
COPY policies.json /etc/chromium/policies/managed/policies.json
COPY openbox.xml /etc/neko/openbox.xml