8000 docker container replace to alpine by 0x676e67 · Pull Request #42 · 0x676e67/thunder · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

docker container replace to alpine #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 16, 2023
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
5 changes: 5 additions & 0 deletions .github/workflows/Docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Setup QEMU
uses: dbhi/qus/action@main
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Tag Check
run: |
echo "tag=3.5.2-13" >> $GITHUB_ENV
Expand Down
35 changes: 11 additions & 24 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,48 +1,35 @@
FROM ubuntu:latest as builder
FROM alpine:latest as builder

ARG VERSION
ARG ARCH

RUN apt update && apt install wget -y
RUN apk update && apk add wget
RUN mkdir -p /var/packages/pan-xunlei-com/target
RUN wget https://github.com/gngpp/xunlei/releases/download/v${VERSION}/xunlei-launch-${VERSION}-${ARCH}-unknown-linux-gnu.tar.gz
RUN tar -xvf xunlei-launch-${VERSION}-${ARCH}-unknown-linux-gnu.tar.gz && chmod 755 /var/packages/pan-xunlei-com/target
RUN mv xunlei-launch-${VERSION}-${ARCH}-unknown-linux-gnu/bin/* /var/packages/pan-xunlei-com/target/
RUN mv xunlei-launch-${VERSION}-${ARCH}-unknown-linux-gnu/xunlei .
RUN wget https://github.com/gngpp/xunlei/releases/download/v${VERSION}/xunlei-launch-${VERSION}-${ARCH}-unknown-linux-musl.tar.gz
RUN tar -xvf xunlei-launch-${VERSION}-${ARCH}-unknown-linux-musl.tar.gz && chmod 755 /var/packages/pan-xunlei-com/target
RUN mv xunlei-launch-${VERSION}-${ARCH}-unknown-linux-musl/bin/* /var/packages/pan-xunlei-com/target/
RUN mv xunlei-launch-${VERSION}-${ARCH}-unknown-linux-musl/xunlei .
COPY authenticate.cgi /var/packages/pan-xunlei-com/target/host/usr/syno/synoman/webman/modules/authenticate.cgi
COPY synoinfo.conf /var/packages/pan-xunlei-com/target/host/etc/synoinfo.conf
RUN chmod 755 /var/packages/pan-xunlei-com/target/host/usr/syno/synoman/webman/modules/authenticate.cgi
RUN chmod 755 /var/packages/pan-xunlei-com/target/host/etc/synoinfo.conf

FROM ubuntu:latest
FROM alpine:latest
LABEL org.opencontainers.image.source https://github.com/gngpp/xunlei
WORKDIR /rootfs

ENV LANG=C.UTF-8 DEBIAN_FRONTEND=noninteractive LANG=zh_CN.UTF-8 LANGUAGE=zh_CN.UTF-8 LC_ALL=C

RUN sed -i 's/archive.ubuntu.com/mirrors.bfsu.edu.cn/g' /etc/apt/sources.list \
&& sed -i 's/security.ubuntu.com/mirrors.bfsu.edu.cn/g' /etc/apt/sources.list \
&& sed -i 's/ports.ubuntu.com/mirrors.bfsu.edu.cn/g' /etc/apt/sources.list \
&& apt-get update && apt-get -y --no-install-recommends install tzdata locales xfonts-wqy wget ca-certificates && rm -rf /var/lib/apt/lists/*

RUN localedef -i zh_CN -c -f UTF-8 -A /usr/share/locale/locale.alias zh_CN.UTF-8 && locale-gen zh_CN.UTF-8 && \
echo "Asia/Shanghai" > /etc/timezone && \
dpkg-reconfigure -f noninteractive tzdata && \
rm -f /etc/localtime && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
find /var/lib/apt/lists -type f -delete && \
find /var/cache -type f -delete

RUN apk update && apk add bash
RUN mkdir /rootfs/bin /rootfs/run \
/rootfs/lib /rootfs/lib64 \
/rootfs/lib32 /rootfs/libx32 \
/rootfs/lib /rootfs/proc \
/rootfs/usr /rootfs/mnt \
/rootfs/etc /rootfs/sbin \
/rootfs/sys /rootfs/dev \
/rootfs/var /rootfs/tmp \
/rootfs/root /rootfs/boot \
/rootfs/proc /opt/xunlei \
/opt/xunlei/downloads && \
mkdir -p /rootfs/opt/xunlei && \
/opt/xunlei /opt/xunlei/downloads && \
mkdir -p /rootfs/opt/xunlei \
mkdir -p /rootfs/opt/xunlei/downloads

COPY run_script.sh /usr/local/bin/
Expand Down
6 changes: 1 addition & 5 deletions docker/run_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ ln -s /var/packages/pan-xunlei-com/target/host/usr/syno/synoman/webman/modules/a
mount --bind /bin /rootfs/bin
mount --bind /run /rootfs/run
mount --bind /lib /rootfs/lib
mount --bind /lib64 /rootfs/lib64
mount --bind /lib32 /rootfs/lib32
mount --bind /libx32 /rootfs/libx32
mount --bind /usr /rootfs/usr
mount --bind /mnt /rootfs/mnt
mount --bind /etc /rootfs/etc
Expand All @@ -22,11 +19,10 @@ mount --bind /dev /rootfs/dev
mount --bind /var /rootfs/var
mount --bind /tmp /rootfs/tmp
mount --bind /root /rootfs/root
mount --bind /boot /rootfs/boot
mount --bind /proc /rootfs/proc
mount --bind /opt/xunlei /rootfs/opt/xunlei
mount --bind /opt/xunlei/downloads /rootfs/opt/xunlei/downloads

chroot /rootfs /bin/bash -c "echo 'nameserver 119.29.29.29' > /etc/resolv.conf && /usr/bin/mount -t proc none /proc && /usr/bin/xunlei launch"
chroot /rootfs /bin/bash -c "echo 'nameserver 119.29.29.29' > /etc/resolv.conf && /bin/mount -t proc none /proc && /usr/bin/xunlei launch"

exec "$@"
0