Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--docker-host flag does not work with Docker sockets #1280

Closed
1 task done
DiffuseHyperion opened this issue Feb 4, 2025 · 1 comment
Closed
1 task done

--docker-host flag does not work with Docker sockets #1280

DiffuseHyperion opened this issue Feb 4, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@DiffuseHyperion
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I am running Nixpacks in a Docker container, with the Docker socket exposed to the container as a volume. However, Nixpacks does not recognize the socket and believes that Docker is not installed, even when --docker-host is used.

To reproduce

  1. Run a Docker container with any image that Nixpacks can be installed onto, for example debian:slim.
  2. Ensure that the Docker socket is exposed to the container with -v /var/run/docker.sock:/var/run/docker.sock
  3. Open a shell within the container with exec -it bash
  4. Install Nixpacks as shown in the documentation
  5. Attempt to build a Docker image with the flag --docker-host.
  6. Notice that Nixpacks believes Docker is not installed.

Here is an example of me trying to build an image in a Docker container.

root@b061154b24e6:/deploydeploydeploy# nixpacks build --docker-host unix:///var/run/docker.sock -n test /deploydeploydeploy/data/projects/528253b8-b153-4cf8-82ff-96356311bb6c/

╔════════════ Nixpacks v1.33.0 ════════════╗
║ setup      │ nodejs_18, npm-9_x, openssl ║
║──────────────────────────────────────────║
║ install    │ npm ci                      ║
║──────────────────────────────────────────║
║ build      │ npm run build               ║
║──────────────────────────────────────────║
║ start      │ npm run start               ║
╚══���═══════════════════════════════════════╝

Error: Please install Docker to build the app https://docs.docker.com/engine/install/
root@b061154b24e6:/deploydeploydeploy#

Expected behavior

The Docker image is built normally. I believe building Docker images via Docker sockets is possible as Docker's Python SDK allows this

Environment

  • Docker Image: python:3.12-slim
    • Base OS: Debian Bookworm Slim (i believe)
  • Nixpacks version: 1.33.0
@DiffuseHyperion DiffuseHyperion added the bug Something isn't working label Feb 4, 2025
@DiffuseHyperion
Copy link
Author

Just fixed this, I didn't realize you had to install Docker too within the container, not just expose the socket.

@DiffuseHyperion DiffuseHyperion closed this as not planned Won't fix, can't repro, duplicate, stale Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant