Skip to content

Commit

Permalink
[nixpacks] use global DOCKER_HOST const
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Mar 11, 2024
1 parent bb211a1 commit 65c672b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nixpacks/src/dagger/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export enum Job {
export const exclude = [];

const DOCKER_VERSION = "25.0.3";
const DOCKER_HOST = "tcp://dockerd:2375";

/**
* Build an OCI image from your project using nixpacks
Expand Down Expand Up @@ -49,7 +50,7 @@ export async function build(
.withDirectory("/app", context)
.withWorkdir("/app")
.withServiceBinding("dockerd", docker(DOCKER_VERSION, true))
.withEnvVariable("DOCKER_HOST", "tcp://dockerd:2375")
.withEnvVariable("DOCKER_HOST", DOCKER_HOST)
.withExec(["nixpacks", "build", path, "--name", name]);
return ctr.stdout();
}
Expand Down Expand Up @@ -116,7 +117,7 @@ export async function dev(
.withDirectory("/app", context)
.withWorkdir("/app")
.withServiceBinding("dockerd", docker(DOCKER_VERSION, true))
.withEnvVariable("DOCKER_HOST", "tcp://dockerd:2375")
.withEnvVariable("DOCKER_HOST", DOCKER_HOST)
.withDefaultTerminalCmd(["bash", "-i"]);

await ctr.stdout();
Expand Down Expand Up @@ -151,7 +152,7 @@ export async function publish(
.withExec(["pkgx", "install", "docker"])
.withExec(["docker", "-v"])
.withServiceBinding("dockerd", docker(DOCKER_VERSION, true))
.withEnvVariable("DOCKER_HOST", "tcp://dockerd:2375")
.withEnvVariable("DOCKER_HOST", DOCKER_HOST)
.withSecretVariable("REGISTRY_PASSWORD", secret!)
.withExec([
"bash",
Expand Down

0 comments on commit 65c672b

Please sign in to comment.