Unable to create Docker image following quickstart on WSL2

This issue has been tracked since 2022-11-04.

Whenever I follow the Quickstart I get the following error as soon as I arrive at the step to execute devbox build

Error: Devbox could not find a buildable plan for this project. If your project/language is currently supported, please create an issue at https://github.com/jetpack-io/devbox/issues - if it's not supported you can request it!

I also tried it with a NodeJS project in which a package-lock.json and a build-script are present. Here I get the same error.

devbox shell works as expected and allows me to run and build the project with npm run build without any problems.

Please note, I'm running on Windows 11 with WSL2.

LucilleH wrote this answer on 2022-11-04

What does your devbox.json look like for your nodejs project? And what is the node version defined in your package.json?

itsmarkvm wrote this answer on 2022-11-05

devbox,json

{
  "packages": [
    "nodejs-18_x"
  ],
  "shell": {
    "init_hook": null
  },
  "build_stage": {
    "command": "npm run build"
  }
}

No NodeJS version is defined in package.json. According to the docs if no version is set Devbox will default to 16.

package.json

{
  "name": "vite-project",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "tsc && vite build",
    "preview": "vite preview"
  },
  "dependencies": { 
    "react": "^18.2.0",
    "react-dom": "^18.2.0"
  },
  "devDependencies": {
    "@types/react": "^18.0.22",
    "@types/react-dom": "^18.0.7",
    "@vitejs/plugin-react": "^2.2.0",
    "typescript": "^4.6.4",
    "vite": "^3.2.0"
  }
}
LucilleH wrote this answer on 2022-11-07

@itsmarkvm Would you mind changing nodejs-18_x to nodejs in devbox.json and try it again? Basically it is trying to match the node version defined in devbox.json to the detected node version in package.json. In this case it doesn't match, so it errors.

I know the current behavior is not ideal. In the future, we might look into creating a base image with all the packages you want in devbox.json, and you can build your Dockerfile on top of that image.

itsmarkvm wrote this answer on 2022-11-20

Sorry for the delayed response, that indeed did the trick. Thank you very much!

More Details About Repo
Owner Name jetpack-io
Repo Name devbox
Full Name jetpack-io/devbox
Language Go
Created Date 2022-08-18
Updated Date 2023-03-31
Star Count 4960
Watcher Count 19
Fork Count 68
Issue Count 42

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date