Skip to content

Run opencode engine in docker sandbox #481

Open

Description

@Aceix

An option, maybe default, to run the opencode backemd in a docker sandbox (https://docs.docker.com/ai/sandboxes/) will be great

Activity

  1. jensenojs commented on Aug 5, 2026

    @jensenojs
    Collaborator

    Could you please briefly explain the value of this scenario?

  2. Davechamu commented on Aug 21, 2026

    @Davechamu

    I actually do this myself, I use podman tho:

    HOST_DIR=$(pwd)
    
    podman run -d \
    --name ocode \
    --userns=keep-id \
    --cap-drop=ALL \
    --security-opt=no-new-privileges:true \
    --replace \
      -p 127.0.0.1:8080:8080 \
      -v "${HOST_DIR}:${HOST_DIR}:Z" \
      -w "${HOST_DIR}" \
      opencode
    
     opencode attach http://127.0.0.1:8080
    

    I am still figuring out the best way to do this, I am still having some issues tuning the accesses opencode gets, I am also trying to block this plugin from auto lunching a local opencode instance as it does not find opencode containers on its own. Setting the url is needed tho.

    vim.g.opencode_opts = {
        server = {
            url = "http://127.0.0.1:8080",
        }
    }
    
    

    It would be nice to able to disable auto launch of local server tho.

    As to the above question. Why? I don't want agents to pollute my machine, there is also code injection issues this can avoid/mitigate, or just dangerous agent hallucinations.

    Also, what about using multiple agents, you can setup containers dynamically, and use a picker to choose which of them you want to put to work on what.

  3. sudo-tee commented on Sep 3, 2026

    @sudo-tee
    Owner

    @Davechamu

    If you set a custom port and url the plugin shoud not autop start a local server if yours is reachable.

    your config should probably seperate both

    vim.g.opencode_opts = {
        server = {
            url = "http://127.0.0.1",
            port = 8080,
        }
    }
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions