railwayapp / nixpacks

App source + Nix packages + Docker = Image
https://nixpacks.com
MIT License
2.48k stars 232 forks source link

Requiring docker when supplying --out #1141

Open lamebear opened 1 month ago

lamebear commented 1 month ago

Is there an existing issue for this?

Describe the bug

I run into an error when running nixpacks build with the --out param:

Error: Please install Docker to build the app https://docs.docker.com/engine/install/

To reproduce

nixpacks build . --name some-name --out path/to/out/dir --no-cache --config assets/nixpacks/golang.toml --build-cmd "go build -o out ./path/to/source"

Expected behavior

Docker should not be required for generating a Dockerfile

Environment

Alpine 3.19 Nixpacks 1.24.6

lamebear commented 1 month ago

Maybe related: #1115

zuchka commented 1 month ago

Hi,

thanks for this. passing along to the product team. thx and more soon

lamebear commented 1 month ago

Original issue stated that it would occasionally work. That was wrong. I embed nixpacks within a docker container as part of my CI pipeline. When building the container locally, the layer would be cached and it would use 1.24.5 while when the pipeline built the container, it would instead pull the latest of 1.24.6. Forcing 1.24.5 fixes the issue.

For context, I use the out parameter to generate the docker file which is then zipped, sent to S3, to be built by Kaniko on Fargate.

mms-gianni commented 2 weeks ago

Same here.

Generating Dockerfile with Nixpacks and building the image on my Kubernetescluster with Buildah. Getting the same error message.

As @lamebear stated: Works as expected with 1.24.5