Skip to content

Commit b30f6e1

Browse files
author
opencode-bot
committed
fix(docker): resolve catalog: deps from root catalog during build; ensure golang-go/node/jq; verified build
1 parent ba03134 commit b30f6e1

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM oven/bun:latest AS base
33
# Core tools required by server features (downloads, unzip, etc.) and gopls support
44
RUN apt-get update \
55
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
6-
ca-certificates curl unzip tar git golang nodejs npm \
6+
ca-certificates curl unzip tar git golang-go nodejs npm jq \
77
&& rm -rf /var/lib/apt/lists/*
88

99
# Create non-root user
@@ -14,9 +14,12 @@ RUN groupadd -g 1001 opencode && \
1414
WORKDIR /app
1515

1616
# Copy only the opencode package files for a minimal build
17-
COPY packages/opencode/package.json ./
17+
COPY packages/opencode/package.json ./package.json
18+
# Provide workspace catalog mapping for catalog: versions
19+
COPY package.json /tmp/root.package.json
1820
RUN sed -i 's/"@opencode-ai\/sdk": "workspace:\*"/"@opencode-ai\/sdk": "latest"/g' package.json && \
19-
sed -i 's/"@opencode-ai\/plugin": "workspace:\*"/"@opencode-ai\/plugin": "latest"/g' package.json
21+
sed -i 's/"@opencode-ai\/plugin": "workspace:\*"/"@opencode-ai\/plugin": "latest"/g' package.json && \
22+
node -e 'const fs=require("fs"); const root=JSON.parse(fs.readFileSync("/tmp/root.package.json","utf8")); const pkg=JSON.parse(fs.readFileSync("package.json","utf8")); const cat=(root.workspaces&&root.workspaces.catalog)||{}; if(pkg.dependencies){for(const k of Object.keys(pkg.dependencies)) if(pkg.dependencies[k]==="catalog:") pkg.dependencies[k]=cat[k]||pkg.dependencies[k];} if(pkg.devDependencies){for(const k of Object.keys(pkg.devDependencies)) if(pkg.devDependencies[k]==="catalog:") pkg.devDependencies[k]=cat[k]||pkg.devDependencies[k];} fs.writeFileSync("package.json", JSON.stringify(pkg, null, 2));'
2023

2124
# Install dependencies (production preferred, fall back to full)
2225
RUN bun install --production || bun install

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"packageManager": "bun@1.2.19",
77
"scripts": {
88
"dev": "bun run --conditions=development packages/opencode/src/index.ts",
9+
"docker:build": "./script/docker-build",
910
"typecheck": "bun run --filter='*' typecheck",
1011
"generate": "(cd packages/sdk && ./js/script/generate.ts) && (cd packages/sdk/stainless && ./generate.ts)",
1112
"postinstall": "./script/hooks"

0 commit comments

Comments
 (0)