Skip to content

Commit e9a72d0

Browse files
committed
Fix persistence docker image #1081
1 parent 5ef0df6 commit e9a72d0

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

.dagger/src/index.ts

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -546,13 +546,31 @@ export class AtomicServer {
546546
throw new Error(`Unknown platform for target: ${target}`);
547547
}
548548

549-
return dag
550-
.container({ platform })
551-
.from("alpine:latest")
552-
.withFile("/usr/local/bin/atomic-server", binary)
553-
.withExec(["chmod", "+x", "/usr/local/bin/atomic-server"])
554-
.withEntrypoint(["/usr/local/bin/atomic-server"])
555-
.withDefaultArgs([]);
549+
const innerImage = "alpine:latest";
550+
551+
// https://github.com/dagger/dagger/issues/9998
552+
const dir = dag.directory().withNewFile(
553+
"Dockerfile",
554+
`FROM ${innerImage}
555+
556+
VOLUME /atomic-storage
557+
`,
558+
);
559+
560+
return (
561+
dag
562+
.container({ platform })
563+
.build(dir)
564+
// .from(innerImage)
565+
.withFile("/usr/local/bin/atomic-server", binary)
566+
.withExec(["chmod", "+x", "/usr/local/bin/atomic-server"])
567+
.withEntrypoint(["/usr/local/bin/atomic-server"])
568+
.withEnvVariable("ATOMIC_DATA_DIR", "/atomic-storage/data")
569+
.withEnvVariable("ATOMIC_CONFIG_DIR", "/atomic-storage/config")
570+
.withEnvVariable("ATOMIC_PORT", "80")
571+
.withExposedPort(80)
572+
.withDefaultArgs([])
573+
);
556574
}
557575

558576
@func()

0 commit comments

Comments
 (0)