jetify-com / devbox

Instant, easy, and predictable development environments
https://www.jetify.com/devbox/
Apache License 2.0
8.66k stars 200 forks source link

Generated Dockerfile fails build because of mkdir /code #1930

Closed s0rbus closed 7 months ago

s0rbus commented 7 months ago

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

tclasen commented 7 months ago

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

mohsenari commented 7 months ago

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