-
Notifications
You must be signed in to change notification settings - Fork 5.1k
docker: add next-generation rootless image with Kubernetes security context support #8061
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
Conversation
- Run as non-root user (UID 1000) by default - Remove gosu dependency and root privilege escalation - Add support for restrictive K8s security contexts - Disable SSH/syslogd in rootless mode (use built-in SSH instead) - Update documentation with migration guide Co-authored-by: unknwon <2946214+unknwon@users.noreply.github.com>
- Use proper if/then for mkdir error checks in start.sh - Add consistent warning messages for directory creation failures - Document that crontabs directory is pre-created by finalize.sh - Log warnings when chmod operations fail on data directories Co-authored-by: unknwon <2946214+unknwon@users.noreply.github.com>
|
|
|
@copilot Keep everything old as-is, but name things related to it as "docker-legacy". The modern way of building name it "docker". If running sshd inside docker requires root, then remove it and let app.ini itself control if builtin SSH server should start. That means we have two sets of everything, including README. |
- Keep original docker setup as docker-legacy/ with sshd support - Create new modern docker/ without sshd (uses built-in SSH via app.ini) - Modern image: runs as non-root, supports K8s security contexts - Add Dockerfile.legacy for building legacy image - Update CI to trigger on both docker/ and docker-legacy/ changes Co-authored-by: unknwon <2946214+unknwon@users.noreply.github.com>
- Add warning when chmod fails in gogs setup - Clarify non-root cron limitations in comment - Add git user context to backup-init comment Co-authored-by: unknwon <2946214+unknwon@users.noreply.github.com>
Done in ae72062. Created dual setup:
SSH access in modern image uses Gogs' built-in SSH server via |
|
@copilot my bad. Keep legacy as "docker", modern as "docker-next" |
- docker/ now contains original legacy setup (sshd, PUID/PGID, gosu) - docker-next/ contains modern rootless setup (K8s security contexts) - Dockerfile uses docker/ (legacy, unchanged behavior) - Dockerfile.next uses docker-next/ (modern, K8s-friendly) Co-authored-by: unknwon <2946214+unknwon@users.noreply.github.com>
… gogs execution - Update to alpine:3.22 and golang:alpine3.22 - Remove s6 process supervisor - run gogs directly - Remove unnecessary packages (rsync, shadow, curl, s6) - Remove nsswitch.conf (not needed) - Expose port 22 for built-in SSH server - Simplify to just: ENTRYPOINT ["/app/gogs/gogs"] CMD ["web"] - Use docker/build/install-task.sh from legacy Co-authored-by: unknwon <2946214+unknwon@users.noreply.github.com>
|
@copilot only push next image to DigitalOcean, legacy no need anymore. |
- Remove DigitalOcean login and tag from buildx (legacy) job - Change deploy-demo to depend on buildx-next instead of buildx Co-authored-by: unknwon <2946214+unknwon@users.noreply.github.com>
|
@copilot make images on ttl.sh 7d instead of 1d |
Co-authored-by: unknwon <2946214+unknwon@users.noreply.github.com>
|
@copilot next image needs to have SSH utilities |
Co-authored-by: unknwon <2946214+unknwon@users.noreply.github.com>
a08ed64 to
7696e03
Compare
7696e03 to
dd8af63
Compare
next-*tagsSummary
Two docker setups are now available:
Legacy (default):
docker/+Dockerfilegogs/gogs:latest,gogs/gogs:<version>(Docker Hub, GHCR only)Next Generation:
docker-next/+Dockerfile.nextgogs/gogs:next-latest,gogs/gogs:next-<version>(Docker Hub, GHCR, DigitalOcean)gogs webapp.ini(START_SSH_SERVER = true)runAsNonRoot,allowPrivilegeEscalation: false,capabilities: { drop: [ALL] }Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.