Skip to content

Commit 65c672b

Browse files
committed
[nixpacks] use global DOCKER_HOST const
1 parent bb211a1 commit 65c672b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

nixpacks/src/dagger/jobs.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export enum Job {
1717
export const exclude = [];
1818

1919
const DOCKER_VERSION = "25.0.3";
20+
const DOCKER_HOST = "tcp://dockerd:2375";
2021

2122
/**
2223
* Build an OCI image from your project using nixpacks
@@ -49,7 +50,7 @@ export async function build(
4950
.withDirectory("/app", context)
5051
.withWorkdir("/app")
5152
.withServiceBinding("dockerd", docker(DOCKER_VERSION, true))
52-
.withEnvVariable("DOCKER_HOST", "tcp://dockerd:2375")
53+
.withEnvVariable("DOCKER_HOST", DOCKER_HOST)
5354
.withExec(["nixpacks", "build", path, "--name", name]);
5455
return ctr.stdout();
5556
}
@@ -116,7 +117,7 @@ export async function dev(
116117
.withDirectory("/app", context)
117118
.withWorkdir("/app")
118119
.withServiceBinding("dockerd", docker(DOCKER_VERSION, true))
119-
.withEnvVariable("DOCKER_HOST", "tcp://dockerd:2375")
120+
.withEnvVariable("DOCKER_HOST", DOCKER_HOST)
120121
.withDefaultTerminalCmd(["bash", "-i"]);
121122

122123
await ctr.stdout();
@@ -151,7 +152,7 @@ export async function publish(
151152
.withExec(["pkgx", "install", "docker"])
152153
.withExec(["docker", "-v"])
153154
.withServiceBinding("dockerd", docker(DOCKER_VERSION, true))
154-
.withEnvVariable("DOCKER_HOST", "tcp://dockerd:2375")
155+
.withEnvVariable("DOCKER_HOST", DOCKER_HOST)
155156
.withSecretVariable("REGISTRY_PASSWORD", secret!)
156157
.withExec([
157158
"bash",

0 commit comments

Comments
 (0)