Skip to content

Commit

Permalink
[nixpacks] enable docker buildx
Browse files Browse the repository at this point in the history
[nixpacks] enable docker buildx
  • Loading branch information
tsirysndr committed Mar 10, 2024
1 parent a57f4a4 commit 8ea353a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nixpacks/src/dagger/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export async function build(
path: string | undefined = "."
): Promise<string> {
const context = await getDirectory(src);
const buildx = dag.container().from("docker/buildx-bin").file("/buildx");
const ctr = dag
.pipeline(Job.build)
.container()
Expand All @@ -36,6 +37,9 @@ export async function build(
.withExec(["pkgx", "install", "nixpacks", "docker"])
.withExec(["nixpacks", "--version"])
.withExec(["docker", "-v"])
.withExec(["mkdir", "-p", "/root/.docker/cli-plugins"])
.withFile("/root/.docker/cli-plugins/docker-buildx", buildx)
.withExec(["docker", "buildx", "version"])
.withDirectory("/app", context)
.withWorkdir("/app")
.withServiceBinding("dockerd", docker("25.0.3", true))
Expand Down
1 change: 1 addition & 0 deletions nixpacks/src/dagger/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const docker = (version = "24.0", cached = false) => {
let ctr = dag
.container()
.from(`docker:${version}-dind`)
.withEnvVariable("DOCKER_CLI_EXPERIMENTAL", "enabled")
.withoutEntrypoint()
.withExposedPort(2375);

Expand Down

0 comments on commit 8ea353a

Please sign in to comment.