Skip to content

Commit

Permalink
1、自定义用户和组
Browse files Browse the repository at this point in the history
2、修改下载目录和数据目录
  • Loading branch information
dream10201 committed Nov 28, 2024
1 parent c97e682 commit 1aac828
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 27 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@ on:
jobs:
docker:
runs-on: ubuntu-latest
permissions:
id-token: write
packages: write
contents: read
attestations: write
steps:
-
name: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GitHub Container Registry
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.CR_PAT }}
-
name: Build and push
- name: Build and push
if: ${{ github.event_name == 'push' }}
uses: docker/build-push-action@v6
with:
push: true
tags: ghcr.io/dream10201/115docker:dev,docker.io/xiuxiu10201/115:dev
-
name: Build and push
- name: Release and push
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: docker/build-push-action@v6
with:
push: true
tags: ghcr.io/dream10201/115docker:latest,docker.io/xiuxiu10201/115:latest
tags: ghcr.io/dream10201/115docker:latest,docker.io/xiuxiu10201/115:latest
23 changes: 14 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM debian:latest AS base
ENV LANG=zh_CN.UTF-8 \
LC_ALL=zh_CN.UTF-8
LC_ALL=zh_CN.UTF-8
RUN apt update \
&& DEBIAN_FRONTEND=noninteractive \
&& apt install -y wget curl unzip locales locales-all \
Expand Down Expand Up @@ -34,6 +34,8 @@ FROM novnc AS oneonefive
ENV \
XDG_CONFIG_HOME=/tmp \
XDG_CACHE_HOME=/tmp \
HOME=/opt \
DISPLAY=:115 \
LD_LIBRARY_PATH=/usr/local/115Browser:\$LD_LIBRARY_PATH
RUN apt update \
&& DEBIAN_FRONTEND=noninteractive \
Expand All @@ -48,15 +50,19 @@ RUN apt update \
&& wget -q --no-check-certificate -c https://github.com/dream10201/115Cookie/archive/refs/heads/master.zip \
&& unzip -j master.zip -d /usr/local/115Cookie/ \
&& rm master.zip \
&& mkdir -p ~/Desktop \
&& cp /usr/share/applications/115Browser.desktop ~/Desktop \
&& cp /usr/share/applications/pcmanfm.desktop ~/Desktop \
&& mkdir -p /opt/115 \
&& mkdir -p /opt/Desktop \
&& mkdir -p /Downloads \
&& chmod 777 -R /Downloads \
&& cp /usr/share/applications/115Browser.desktop /opt/Desktop \
&& cp /usr/share/applications/pcmanfm.desktop /opt/Desktop \
&& chmod 777 -R /opt \
&& mkdir -p /etc/115 \
&& chmod 777 -R /etc/115 \
&& echo "cd /usr/local/115Browser" > /usr/local/115Browser/115.sh \
&& echo "/usr/local/115Browser/115Browser \
--test-type \
--disable-backgrounding-occluded-windows \
--user-data-dir=/opt/115 \
--user-data-dir=/etc/115 \
--disable-cache \
--load-extension=/usr/local/115Cookie \
--disable-wav-audio \
Expand Down Expand Up @@ -87,6 +93,5 @@ RUN apt update \

FROM oneonefive
EXPOSE 1150
ENV DISPLAY=:115
COPY run.sh /run.sh
CMD ["bash","/run.sh"]
COPY run.sh /opt/run.sh
CMD ["bash","/opt/run.sh"]
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ docker pull ghcr.io/dream10201/115docker:latest
## 运行命令
```shell
docker run --name=115 \
--user 0:0
--env PASSWORD=123456 \
--env DISPLAY_WIDTH=1920 \
--env DISPLAY_HEIGHT=1080 \
--rm --network=host -d --tmpfs /tmp \
--label io.containers.autoupdate=registry \
--rm --network=host -d \
--env TZ=Asia/Shanghai \
docker.io/xiuxiu10201/115:latest
```
Expand All @@ -35,8 +35,8 @@ docker.io/xiuxiu10201/115:latest

| 路径 | 描述 | 必须|
|:---------:|:---------:|:---------:|
|/opt/115|115浏览器数据目录|N|
|/root/Downloads|下载目录|N|
|/etc/115|115浏览器数据目录|N|
|/Downloads|下载目录|N|

## 端口占用
| 端口 | 描述 | 必须|
Expand Down
4 changes: 1 addition & 3 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash
sed -i "s/const CID=\"\"/const CID=\"${CID}\"/" /usr/local/115Cookie/worker.js
sed -i "s/const SEID=\"\"/const SEID=\"${SEID}\"/" /usr/local/115Cookie/worker.js
sed -i "s/const UID=\"\"/const UID=\"${UID}\"/" /usr/local/115Cookie/worker.js
sed -i "1s/^/const CID=\"${CID}\"\nconst SEID=\"${SEID}\"\nconst UID=\"${UID}\"\n/" /usr/local/115Cookie/worker.js
if [ -z "${DISPLAY_WIDTH}" ]; then
DISPLAY_WIDTH=1366
fi
Expand Down

0 comments on commit 1aac828

Please sign in to comment.