Sysbox container runtime, Docker Image, Build #1 failed

At the first build of the workspace, I get the following error:

docker_image.my_image: Creation complete after 1m19s [id=sha256:140c1336981db4865013ceeb62a250c1ebdd390261a9f27021b36bf1209d7c75my-image] Error: Unable to create container with image my_image:develop: unable to pull image my_image:develop: error pulling image my_image:develop: Error response from daemon: pull access denied for my_image, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

As the image is built:

REPOSITORY TAG IMAGE ID CREATED SIZE my-image latest 140c1336981d 2 hours ago 1.68GB my_image develop 140c1336981d 2 hours ago 1.68GB

and that docker run -it my_image works fine.

I have to restart the workspace so that everything runs without error. Any ideas for solutions?

main.tf :

resource "docker_image" "my_image" { name = "my-image" build { context = "./build" tag = ["my_image:develop"] } }

resource "docker_container" "workspace" { # ... name = "coder-${data.coder_workspace.me.owner}-${lower(data.coder_workspace.me.name)}" image = "my_image:develop" 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" }

I get the same error with:

name = docker_image.my_image.develop

And Dockerfile:

FROM codercom/enterprise-base:ubuntu # install the latest version USER root RUN curl -fsSL https://code-server.dev/install.sh | sh USER coder # pre-install VS Code extensions #RUN code-server --install-extension eamodio.gitlens # directly start code-server with the agent's startup_script (see above), # or use a process manager like supervisord
Was this page helpful?