Skip to content

Commit 03808d1

Browse files
committed
feat(docker): add engram integration and mcp configurations
- Introduce ARG and ENV for engram (v1.9.1), azure-foundry-provider (0.2.0), OPENCODE_EXPERIMENTAL=1, and ENGRAM_DATA_DIR - Install engram binary and plugin from GitHub releases - Pin azure-foundry-provider to specific version - Create OPENCODE_PLUGINS_DIR and opencode.json with MCP configs for engram, sequential-thinking, and aleph - Update skills dir to OPENCODE_CONFIG_DIR/skills and adjust permissions/ownership
1 parent c5d6caf commit 03808d1

File tree

1 file changed

+61
-8
lines changed

1 file changed

+61
-8
lines changed

Dockerfile

Lines changed: 61 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,27 @@ else
6262
fi
6363
EOF
6464

65-
chown -Rh bun:bun "$(echo ~bun)"
66-
6765
FOE
6866

6967
COPY --chmod=0555 entrypoint.sh /entrypoint.sh
7068

7169
ARG OPENCODE_VERSION=latest
70+
ARG AZURE_FOUNDRY_PROVIDER_VERSION=0.2.0
71+
ARG ENGRAM_VERSION=v1.9.1
72+
7273
ENV OPENCODE_CONFIG_DIR=/etc/opencode
74+
ENV OPENCODE_EXPERIMENTAL=1
75+
ENV ENGRAM_DATA_DIR=/home/bun/.local/share/opencode/engram
7376

7477
# hadolint ignore=DL3003,SC2164
7578
RUN <<'FOE'
7679

7780
export BUN_INSTALL=/usr/local/bun
7881
export PROVIDER_DIR=/usr/local/provider
82+
export OPENCODE_PLUGINS_DIR="${OPENCODE_CONFIG_DIR}/plugins"
7983

80-
mkdir -p "${BUN_INSTALL}" "${OPENCODE_CONFIG_DIR}" "${PROVIDER_DIR}"
84+
mkdir -p "${BUN_INSTALL}" "${OPENCODE_CONFIG_DIR}" "${OPENCODE_PLUGINS_DIR}" "${PROVIDER_DIR}"
85+
chmod 0777 "${OPENCODE_CONFIG_DIR}"
8186

8287
bun install -g "opencode-ai@${OPENCODE_VERSION}" || exit 1
8388

@@ -86,31 +91,38 @@ bun install -g "opencode-ai@${OPENCODE_VERSION}" || exit 1
8691
#
8792
pushd /tmp
8893

89-
bun install "github:ophiosdev/azure-foundry-provider" || exit 1
94+
bun install "github:ophiosdev/azure-foundry-provider#v${AZURE_FOUNDRY_PROVIDER_VERSION}" || exit 1
9095
cd node_modules/azure-foundry-provider || exit 1
9196
bun build --outdir=dist src/index.ts || exit 1
9297
mv dist "${PROVIDER_DIR}/azure-foundry-provider"
9398
rm -rf /tmp/*
9499

95100
popd || exit 1
96101

102+
engram_version="${ENGRAM_VERSION#v}"
103+
engram_archive="engram_${engram_version}_linux_amd64.tar.gz"
104+
engram_url="https://github.com/Gentleman-Programming/engram/releases/download/${ENGRAM_VERSION}/${engram_archive}"
105+
curl -fsSL "${engram_url}" | tar -C /usr/local/bin -xvzf - engram
106+
curl -fsSL 'https://raw.githubusercontent.com/Gentleman-Programming/engram/refs/tags/${ENGRAM_VERSION}/plugin/opencode/engram.ts' -o "${OPENCODE_PLUGINS_DIR}/engram.ts"
107+
108+
97109
rm -rf /root/.bun
98110

111+
chown -Rh bun:bun "$(echo ~bun)"
112+
99113
FOE
100114

101-
USER bun
115+
USER bun:bun
102116

103117
RUN mise use -g --silent python@3.12.12 go@1.24 ripgrep uv
104118

105119
# hadolint ignore=DL3045
106120
COPY --chown=bun:bun git-export.py git-export.py
107121

108-
ENV XDG_CONFIG_HOME=/home/bun/.config
109-
110122
RUN <<'FOE'
111123
source /etc/bash.bashrc
112124

113-
skills_dir="${XDG_CONFIG_HOME}/opencode/skills"
125+
skills_dir="${OPENCODE_CONFIG_DIR}/skills"
114126
mkdir -p "${skills_dir}"
115127

116128
skill_name="humanizer"
@@ -126,8 +138,49 @@ RUN <<'FOE'
126138
python git-export.py https://github.com/sickn33/antigravity-awesome-skills/skills/changelog-automation "${skills_dir}/${skill_name}" --force
127139

128140
rm -f git-export.py
141+
142+
cat >"${OPENCODE_CONFIG_DIR}/opencode.json" <<-'EOF'
143+
{
144+
"$schema": "https://opencode.ai/config.json",
145+
"plugin": [
146+
"engram"
147+
],
148+
"mcp": {
149+
"engram": {
150+
"command": [
151+
"engram",
152+
"mcp",
153+
"--tools=agent"
154+
],
155+
"enabled": true,
156+
"type": "local"
157+
},
158+
"sequential-thinking": {
159+
"type": "local",
160+
"command": [
161+
"bun",
162+
"x",
163+
"@modelcontextprotocol/server-sequential-thinking"
164+
]
165+
},
166+
"aleph": {
167+
"type": "local",
168+
"command": [
169+
"aleph",
170+
"--enable-actions",
171+
"--workspace-mode",
172+
"any",
173+
"--tool-docs",
174+
"concise"
175+
]
176+
}
177+
}
178+
}
179+
EOF
180+
129181
FOE
130182

183+
131184
# Set BASH_ENV so non-interactive bash shells (spawned by OpenCode CLI) source /etc/bash.bashrc
132185
# This ensures mise activation and PATH are available in shell commands
133186
ENV BASH_ENV=/etc/bash.bashrc

0 commit comments

Comments
 (0)