Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (47 loc) · 1.87 KB
/
Copy pathDockerfile
File metadata and controls
58 lines (47 loc) · 1.87 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# opencode с харнессом TDD/PRD внутри python-dev контейнера.
FROM ubuntu:24.04
ARG OPENCODE_VERSION=1.18.34
ARG HARNESS_REF=2795f16
ARG DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8 \
PATH=/home/box/.opencode/bin:$PATH:/opt/devtools/bin
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
python3-venv \
python3-pip \
python3-dev \
build-essential \
git \
make \
curl \
ca-certificates \
ripgrep \
jq \
&& rm -rf /var/lib/apt/lists/*
COPY requirements-devtools.txt /tmp/requirements-devtools.txt
RUN python3 -m venv /opt/devtools \
&& /opt/devtools/bin/pip install --no-cache-dir --disable-pip-version-check \
-r /tmp/requirements-devtools.txt \
&& rm /tmp/requirements-devtools.txt \
&& test "$(/opt/devtools/bin/pip list --format=freeze | wc -l)" -ge 6
RUN usermod -l box ubuntu \
&& groupmod -n box ubuntu \
&& usermod -d /home/box -m box \
&& mkdir -p /home/box/.local/share/opencode /home/box/.cache \
&& chown -R box:box /home/box/.local /home/box/.cache \
&& mkdir -p /workspace \
&& chown box:box /workspace
RUN HOME=/home/box sh -c \
'curl -fsSL https://opencode.ai/install | bash -s -- --version "$OPENCODE_VERSION" --no-modify-path' \
&& test "$(opencode --version)" = "$OPENCODE_VERSION"
RUN git clone --quiet https://github.com/teterkin/opencode-harness /opt/opencode-harness \
&& git -C /opt/opencode-harness checkout --quiet --detach "$HARNESS_REF" \
&& HOME=/home/box /opt/opencode-harness/install.sh \
&& chmod -R a+rX /opt/opencode-harness
RUN chown root:root /home/box && chmod 755 /home/box
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod 755 /usr/local/bin/entrypoint.sh
USER box
WORKDIR /workspace
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["opencode"]