devbox icon indicating copy to clipboard operation
devbox copied to clipboard

Generated Dockerfile fails build because of mkdir /code

Open s0rbus opened this issue 1 year ago • 1 comments

What happened?

I ran devbox generate and tried to use the generated files in vscode to create a devcontainer. Build fails because the generated Dockerfile first runs WORKDIR /code then later attempts RUN mkdir /code && chown ${DEVBOX_USER}:${DEVBOX_USER} /code. The WORKDIR command creates /code so then mkdir /code fails.

I also tried this out by attempting to manually create a docker image using the generated Dockerfile - this fails for same reason.

I suggest the mkdir /code is removed OR WORKDIR /code is moved to later in the Dockerfile. When I removed mkdir /code then everything works as expected.

Steps to reproduce

  1. devbox generate devcontainer
  2. open folder in vscode which should build an image and run container

Command

generate

devbox.json

{
  "$schema": "https://raw.githubusercontent.com/jetpack-io/devbox/0.10.1/.schema/devbox.schema.json",
  "packages": [
    "python310@latest",
    "jq@latest"
  ],
  "shell": {
    "init_hook": [
      "echo 'Welcome to devbox!' > /dev/null"
    ],
    "scripts": {
      "test": [
        "echo \"Error: no test specified\" && exit 1"
      ]
    }
  }
}

Devbox version

0.10.1

Nix version

2.21.0

What system does this bug occur on?

Linux (ARM64)

Debug logs

No response

s0rbus avatar Mar 27 '24 16:03 s0rbus

Damn it... I thought I searched this well enough before posting... Thanks for the tag.

tclasen avatar Apr 02 '24 22:04 tclasen

@s0rbus With the release of devbox v0.10.4 this issue is resolved.

mohsenari avatar Apr 09 '24 14:04 mohsenari