Skip to content

Commit

Permalink
基础镜像改为debian,直接集成安装好chromium,所有功能支持amd64,arm64,armv7三大平台。 (#399)
Browse files Browse the repository at this point in the history
* 基础镜像改为debian,直接集成安装好chromium,体积虽然增大了,但是无需在每次启动时下载chrome了。并且,所有功能都支持amd64,arm64,armv7三大平台。

* entrypoint增加tini
  • Loading branch information
devome committed Jun 10, 2022
1 parent da3c682 commit 843dc93
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 27 deletions.
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ RUN cd /tmp \
&& ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \
&& echo "${TZ}" > /etc/timezone \
&& rm -rf /tmp/*
COPY normal-rootfs /
ENTRYPOINT ["/init"]
COPY entrypoint.sh /usr/bin/entrypoint.sh
ENTRYPOINT ["tini", "entrypoint.sh"]
WORKDIR /config
VOLUME ["/config", "/media"]

7 changes: 5 additions & 2 deletions docker/base.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
FROM ubuntu
FROM debian
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
ca-certificates \
chromium \
dbus-x11 \
dumb-init \
ffmpeg \
fonts-liberation \
fonts-noto-cjk \
fonts-noto-color-emoji \
gosu \
gtk2-engines-pixbuf \
imagemagick \
libasound2 \
Expand All @@ -19,6 +21,7 @@ RUN apt-get update \
libstdc++6 \
libxss1 \
libxtst6 \
tini \
tzdata \
wget \
x11-apps \
Expand All @@ -30,10 +33,10 @@ RUN apt-get update \
xorg \
xvfb \
yasm \
&& ln -s /usr/bin/chromium /usr/bin/chrome \
&& apt-get clean \
&& rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
COPY --from=nevinee/s6-overlay:2.2.0.3-bin-is-softlink / /

Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
#!/usr/bin/with-contenv bash

## 软连接chrome
if [[ -n $(ls /root/.cache/rod/browser 2>/dev/null) ]]; then
target_chrome=/root/.cache/rod/browser/$(ls -t /root/.cache/rod/browser | head -1)/chrome-linux/chrome
if [[ -L /usr/bin/chrome && $(readlink -f /usr/bin/chrome) != $target_chrome ]]; then
rm -f /usr/bin/chrome
ln -s $target_chrome /usr/bin/chrome &>/dev/null
elif [[ ! -e /usr/bin/chrome ]]; then
ln -s $target_chrome /usr/bin/chrome &>/dev/null
fi
fi
#!/bin/bash

## 重设权限
chown -R "${PUID}:${PGID}" /config /root
chown -R "${PUID}:${PGID}" /config
if [[ ${PERMS} == true ]]; then
echo "已设置 PERMS=true,重设 '/media' 目录权限为 ${PUID}:${PGID} 所有..."
chown -R ${PUID}:${PGID} /media
Expand All @@ -26,11 +15,17 @@ if [[ -d /app/cache ]]; then
rm -rf /config/cache &>/dev/null
fi
if [[ ! -e /config/cache ]]; then
s6-setuidgid ${PUID}:${PGID} ln -sf /app/cache /config/cache
gosu ${PUID}:${PGID} ln -sf /app/cache /config/cache
fi
else
if [[ -L /config/cache ]]; then
echo "检测到 '/config/cache' 指向了不存在的目录 '/app/cache',删除之,如想保留缓存,请将旧的 'cache' 目录移动到 '/config' 路径下..."
rm -rf /config/cache &>/dev/null
fi
fi

## 启动
umask ${UMASK}
cd /config
Xvfb -ac ${DISPLAY} -screen 0 1280x1024x16 &
gosu ${PUID}:${PGID} chinesesubfinder
6 changes: 0 additions & 6 deletions docker/normal-rootfs/etc/services.d/chinesesubfinder/run

This file was deleted.

3 changes: 0 additions & 3 deletions docker/normal-rootfs/etc/services.d/xvfb/run

This file was deleted.

0 comments on commit 843dc93

Please sign in to comment.