-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (23 loc) · 977 Bytes
/
Dockerfile
File metadata and controls
34 lines (23 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM oven/bun:1 AS builder
WORKDIR /build
# clone repo
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
RUN git clone https://github.com/anomalyco/opencode.git .
# apply plugin-skip patch
COPY plugin-skip.patch /tmp/plugin-skip.patch
RUN git apply /tmp/plugin-skip.patch
# build opencode
RUN cd packages/opencode && bun install
RUN cd packages/opencode && bun run build
# alpine base
FROM alpine AS base
RUN apk add libgcc libstdc++ ripgrep jq curl gcompat
COPY --from=builder /build/packages/opencode/dist/opencode-linux-x64-baseline-musl/bin/opencode /usr/local/bin/opencode
COPY --from=builder /usr/local/bin/bun /usr/local/bin/bun
# create version file first to prevent cache wipe
RUN mkdir -p /root/.cache/opencode && opencode --version
# copy config
COPY opencode.json /root/.config/opencode/opencode.json
# download models.json
RUN curl -fsSL https://models.dev/api.json -o /root/.cache/opencode/models.json
ENTRYPOINT ["opencode"]