diff options
| author | Dax Raad <[email protected]> | 2026-01-29 23:13:07 -0500 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2026-01-29 23:13:07 -0500 |
| commit | 5ea1042ffba32b4e1b66e8944b5ec8c3899f5674 (patch) | |
| tree | 1cb70cea0810db2ad6b2452b7d2ac08bb047c399 | |
| parent | 71d280d570ea77c9330942722b0e34383de831d9 (diff) | |
| download | opencode-5ea1042ffba32b4e1b66e8944b5ec8c3899f5674.tar.gz opencode-5ea1042ffba32b4e1b66e8944b5ec8c3899f5674.zip | |
ci
| -rw-r--r-- | packages/containers/bun-node/Dockerfile | 2 | ||||
| -rw-r--r-- | packages/containers/script/build.ts | 25 |
2 files changed, 19 insertions, 8 deletions
diff --git a/packages/containers/bun-node/Dockerfile b/packages/containers/bun-node/Dockerfile index 69c780396..31a3bb547 100644 --- a/packages/containers/bun-node/Dockerfile +++ b/packages/containers/bun-node/Dockerfile @@ -2,7 +2,7 @@ ARG REGISTRY=ghcr.io/anomalyco FROM ${REGISTRY}/build/base:24.04 ARG NODE_VERSION=24.4.0 -ARG BUN_VERSION=1.2.4 +ARG BUN_VERSION=1.3.5 ENV BUN_INSTALL=/opt/bun ENV PATH=/opt/bun/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin diff --git a/packages/containers/script/build.ts b/packages/containers/script/build.ts index 8fd6a7d4d..0ace10731 100644 --- a/packages/containers/script/build.ts +++ b/packages/containers/script/build.ts @@ -2,25 +2,36 @@ import { $ } from "bun" -const dir = new URL("..", import.meta.url).pathname -process.chdir(dir) +const rootDir = new URL("../../..", import.meta.url).pathname +process.chdir(rootDir) const reg = process.env.REGISTRY ?? "ghcr.io/anomalyco" const tag = process.env.TAG ?? "24.04" const push = process.argv.includes("--push") || process.env.PUSH === "1" +const root = new URL("package.json", new URL(rootDir)).pathname +const pkg = await Bun.file(root).json() +const manager = pkg.packageManager ?? "" +const bun = manager.startsWith("bun@") ? manager.slice(4) : "" +if (!bun) throw new Error("packageManager must be bun@<version>") + const images = ["base", "bun-node", "rust", "tauri-linux", "publish"] for (const name of images) { const image = `${reg}/build/${name}:${tag}` const file = `packages/containers/${name}/Dockerfile` - const arg = name === "base" ? "" : `--build-arg REGISTRY=${reg}` - console.log(`docker build -f ${file} -t ${image} ${arg} .`) - if (arg) { - await $`docker build -f ${file} -t ${image} --build-arg REGISTRY=${reg} .` - } else { + if (name === "base") { + console.log(`docker build -f ${file} -t ${image} .`) await $`docker build -f ${file} -t ${image} .` } + if (name === "bun-node") { + console.log(`docker build -f ${file} -t ${image} --build-arg REGISTRY=${reg} --build-arg BUN_VERSION=${bun} .`) + await $`docker build -f ${file} -t ${image} --build-arg REGISTRY=${reg} --build-arg BUN_VERSION=${bun} .` + } + if (name !== "base" && name !== "bun-node") { + console.log(`docker build -f ${file} -t ${image} --build-arg REGISTRY=${reg} .`) + await $`docker build -f ${file} -t ${image} --build-arg REGISTRY=${reg} .` + } if (push) { await $`docker push ${image}` |
