-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat(ci): Add the default user for docker execution #1036
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
feat(ci): Add the default user for docker execution #1036
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a default user configuration for Docker execution, improving security by running the container as a non-root user instead of root. The changes implement proper user creation and permission management in Docker containers.
Key changes:
- Adds user creation with configurable UID/GID in Dockerfiles
- Removes dynamic user switching from entrypoint script
- Improves aria2 service management with proper directory handling
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Dockerfile | Adds user creation with default openlist user (UID 1001) and sets USER directive |
| Dockerfile.ci | Mirrors the user configuration changes from main Dockerfile |
| entrypoint.sh | Removes su-exec user switching and improves aria2 directory management logic |
Co-authored-by: Copilot <[email protected]> Signed-off-by: 我怎么就不是一只猫呢? <[email protected]>
…st into docker-add-default-user
TARGETPLATFORM only used in ci Signed-off-by: 我怎么就不是一只猫呢? <[email protected]>
|
@dezhishen 发现个问题,仓库里面的 docker-compose.yml 没改 https://github.com/OpenListTeam/OpenList/blob/main/docker-compose.yml |
must merge the docker-library#12 first
测试镜像
base-image: dezhishen/openlist-base-image:aio
office-base-image: openlistteam/openlist-base-image:aio
test-image: dezhishen/openlist:aio-test
测试
构建自己的镜像
运行测试镜像
查看日志
查看文件夹权限
docker exec -it openlist-test ls -l /opt/service/start/ total 8 drwxr-xr-x 4 1000 1000 4096 Aug 11 08:10 aria2 drwxr-xr-x 3 1000 1000 4096 Aug 11 08:10 openlistdocker exec -it openlist-test ls -l /opt/openlist/data total 244 -rw-r--r-- 1 1000 1000 2768 Aug 11 08:10 config.json -rw-r--r-- 1 1000 1000 4096 Aug 11 08:10 data.db -rw-r--r-- 1 1000 1000 32768 Aug 11 08:10 data.db-shm -rw-r--r-- 1 1000 1000 197792 Aug 11 08:10 data.db-wal drwxr-xr-x 3 1000 1000 4096 Aug 11 08:10 log drwxr-xr-x 2 1000 1000 4096 Aug 11 08:10 temp