Feat/reorganize dockerfiles - #4
Merged
Merged
Conversation
…ilities Remove USER directive from both Dockerfiles and set user: 1000:1000 in docker-compose.yml. Replace cap_drop: ALL with targeted drops and add capabilities needed for sudo (SETUID, SETGID, DAC_OVERRIDE, FOWNER). Set no-new-privileges:false to allow privilege escalation.
Add UID check to handle both compose user mode (1000:1000) and root mode. Root path performs chown and su -l to switch user. Non-root path skips chown and executes command directly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors the OpenCode Docker environment for both CPU and GPU images, focusing on improved user configuration, reproducibility, and security. The changes standardize the installation and configuration process, move all user-level installs to the non-root user, simplify config switching, and clarify agent and project conventions. It also updates documentation and tightens up Docker Compose settings for better control and security.
Container build and user management improvements:
hannya), ensuring correct permissions and environment setup. ThePATHis updated to prioritize user binaries, and theHOMEenvironment variable is set to the user's home directory. [1] [2].config/opencode/directory during the build, and a script (switch-opencode-config) is installed for easy config switching. [1] [2]entrypoint.sh) is rewritten to handle both root and non-root startup, ensure proper ownership of the home directory, and activate the requested OpenCode config on container start.Configuration and conventions:
oh-my-openagent-*.json). Usage messages are clarified, and the default config is restored from a new default file.Docker Compose and security enhancements:
1000:1000, pass throughMYUIDandMYGID, and default to thefreeOpenCode config. [1] [2] [3] [4]no-new-privilegesis set tofalse, and a more granular set of capabilities is dropped/added to balance functionality and security. [1] [2]Documentation updates:
AGENTS.mdprovides a clear overview of the repo, conventions, commands, and strict agent/Git rules for working in this environment.Summary of most important changes:
User environment and installation:
Configuration and conventions:
switch-opencode-config.sh) is simplified and standardized for easier use and maintenance.Docker Compose and security:
Documentation:
AGENTS.mdoutlining usage, conventions, and agent rules for the environment.