Sysbox in Docker-based templates, volumes, bad rights

I want to persist the data from the coder home to a docker volume.

The workspace is built and starts. But permissions are override by docker:

coder@d9413135b9b2:~$ ls -al total 28 drwxr-xr-x 3 nobody nogroup 4096 Feb 17 01:26 . drwxr-xr-x 1 root root 4096 Feb 13 02:30 .. -rw-r--r-- 1 nobody nogroup 220 Feb 25 2020 .bash_logout -rw-r--r-- 1 nobody nogroup 3771 Feb 25 2020 .bashrc drwxr-xr-x 3 nobody nogroup 4096 Feb 17 01:26 .cache -rw-r--r-- 1 nobody nogroup 807 Feb 25 2020 .profile

Impossible to do anything.

maint.tf:

resource "docker_volume" "home_volume" { # This resource will survive until either the entire block is deleted # or the workspace is. name = "coder-${data.coder_workspace.me.id}-home" lifecycle { ignore_changes = all } } resource "docker_container" "workspace" { # ... name = "coder-${data.coder_workspace.me.owner}-${lower(data.coder_workspace.me.name)}" image = "codercom/enterprise-base:ubuntu" env = ["CODER_AGENT_TOKEN=${coder_agent.main.token}"] command = ["sh", "-c", coder_agent.main.init_script] # Use the Sysbox container runtime (required) runtime = "sysbox-runc" volumes { container_path = "/home/coder/" volume_name = docker_volume.home_volume.name } }
Was this page helpful?