Skip to content

Commit d9660f5

Browse files
committed
refactor(docker): h use configurable build directory for skills
Add OPENCODE_BUILD_DIR build argument to make skill installation location configurable. Move scripts and skills.yaml from /tmp to dedicated build directory for better organization and clean up after installation completes.
1 parent 7b8e1d7 commit d9660f5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ FOE
8181
ARG OPENCODE_VERSION=latest
8282
ARG AZURE_FOUNDRY_PROVIDER_VERSION=0.2.0
8383
ARG ENGRAM_VERSION=latest
84+
ARG OPENCODE_BUILD_DIR=/usr/local/share/opencode-build
8485

8586
ENV OPENCODE_CONFIG_DIR=/etc/opencode
8687
ENV OPENCODE_EXPERIMENTAL=1
@@ -176,16 +177,16 @@ chown -Rh bun:bun "$(echo ~bun)"
176177
FOE
177178

178179
# hadolint ignore=DL3045
179-
COPY scripts /tmp/scripts
180-
COPY skills.yaml /tmp/skills.yaml
180+
COPY scripts "${OPENCODE_BUILD_DIR}/scripts"
181+
COPY skills.yaml "${OPENCODE_BUILD_DIR}/skills.yaml"
181182

182183
RUN <<'FOE'
183184
source /etc/bash.bashrc
184185

185-
BUN_INSTALL=/tmp/bun bun install --cwd /tmp/scripts yaml || exit 1
186-
bun /tmp/scripts/install-skills.ts || exit 1
186+
BUN_INSTALL=/tmp/bun bun install --cwd "${OPENCODE_BUILD_DIR}/scripts" yaml || exit 1
187+
bun "${OPENCODE_BUILD_DIR}/scripts/install-skills.ts" || exit 1
187188

188-
rm -rf /tmp/*
189+
rm -rf "${OPENCODE_BUILD_DIR}"
189190

190191

191192
cat >"${OPENCODE_CONFIG_DIR}/opencode.json" <<-'EOF'

0 commit comments

Comments
 (0)