Skip to content

Commit 8ea353a

Browse files
committed
[nixpacks] enable docker buildx
[nixpacks] enable docker buildx
1 parent a57f4a4 commit 8ea353a

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

nixpacks/src/dagger/jobs.ts

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export async function build(
2828
path: string | undefined = "."
2929
): Promise<string> {
3030
const context = await getDirectory(src);
31+
const buildx = dag.container().from("docker/buildx-bin").file("/buildx");
3132
const ctr = dag
3233
.pipeline(Job.build)
3334
.container()
@@ -36,6 +37,9 @@ export async function build(
3637
.withExec(["pkgx", "install", "nixpacks", "docker"])
3738
.withExec(["nixpacks", "--version"])
3839
.withExec(["docker", "-v"])
40+
.withExec(["mkdir", "-p", "/root/.docker/cli-plugins"])
41+
.withFile("/root/.docker/cli-plugins/docker-buildx", buildx)
42+
.withExec(["docker", "buildx", "version"])
3943
.withDirectory("/app", context)
4044
.withWorkdir("/app")
4145
.withServiceBinding("dockerd", docker("25.0.3", true))

nixpacks/src/dagger/lib.ts

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const docker = (version = "24.0", cached = false) => {
2626
let ctr = dag
2727
.container()
2828
.from(`docker:${version}-dind`)
29+
.withEnvVariable("DOCKER_CLI_EXPERIMENTAL", "enabled")
2930
.withoutEntrypoint()
3031
.withExposedPort(2375);
3132

0 commit comments

Comments
 (0)