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 env variable being ignored #1194

Open
1 task done
eyenalxai opened this issue Sep 22, 2024 · 2 comments
Open
1 task done

DOCKER_HOST env variable being ignored #1194

eyenalxai opened this issue Sep 22, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@eyenalxai
Copy link

eyenalxai commented Sep 22, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

nixpacks now ignores the DOCKER_HOST environment variable. It seems that a bug was introduced somewhere between versions 1.27.1 and 1.28.0

This seems related:
#1180
#1176

To reproduce

1.28.0

❯ DOCKER_HOST=unix:///run/user/1000/docker.sock nixpacks build .

╔═══════════════════════ Nixpacks v1.28.0 ═══════════════════════╗
║ setup      │ nodejs_22, yarn-1_x, openssl                      ║
║────────────────────────────────────────────────────────────────║
║ install    │ npm install -g [email protected] && corepack enable ║
║            │ yarn install --check-cache                        ║
║────────────────────────────────────────────────────────────────║
║ build      │ yarn run build                                    ║
║────────────────────────────────────────────────────────────────║
║ start      │ yarn run migrate && yarn run start                ║
╚════════════════════════════════════════════════════════════════╝

ERROR: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Head "http://%2Fvar%2Frun%2Fdocker.sock/_ping": dial unix /var/run/docker.sock: connect: permission denied
Error: Docker build failed

Notice that it tries to connect to unix:///var/run/docker.sock instead of unix:///run/user/1000/docker.sock from DOCKER_HOST env variable

Expected behavior

1.27.1

❯ DOCKER_HOST=unix:///run/user/1000/docker.sock nixpacks build .

╔═══════════════════════ Nixpacks v1.27.1 ═══════════════════════╗
║ setup      │ nodejs_22, yarn-1_x, openssl                      ║
║────────────────────────────────────────────────────────────────║
║ install    │ npm install -g [email protected] && corepack enable ║
║            │ yarn install --check-cache                        ║
║────────────────────────────────────────────────────────────────║
║ build      │ yarn run build                                    ║
║────────────────────────────────────────────────────────────────║
║ start      │ yarn run migrate && yarn run start                ║
╚════════════════════════════════════════════════════════════════╝

[+] Building 1.0s (2/2) FINISHED  ...

Proceeds as normal

Environment

Arch Linux

@eyenalxai eyenalxai added the bug Something isn't working label Sep 22, 2024
@eyenalxai
Copy link
Author

eyenalxai commented Sep 27, 2024

Still happens in 1.29.0

❯ DOCKER_HOST=unix:///run/user/1000/docker.sock nixpacks build .

╔═══════════════════════ Nixpacks v1.29.0 ═══════════════════════╗
║ setup      │ nodejs_22, yarn-1_x, openssl                      ║
║────────────────────────────────────────────────────────────────║
║ install    │ npm install -g [email protected] && corepack enable ║
║            │ yarn install --check-cache                        ║
║────────────────────────────────────────────────────────────────║
║ build      │ yarn run build                                    ║
║────────────────────────────────────────────────────────────────║
║ start      │ yarn run migrate && yarn run start                ║
╚════════════════════════════════════════════════════════════════╝

ERROR: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Head "http://%2Fvar%2Frun%2Fdocker.sock/_ping": dial unix /var/run/docker.sock: connect: permission denied
Error: Docker build failed

@coffee-cup
Copy link
Contributor

You can specify the host by providing the --docker-host argument when building.

nixpacks build --docker-host unix:///run/user/1000/docker.sock .

We should still fix this and support the environment variable though

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

2 participants