-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile
More file actions
50 lines (39 loc) · 1.17 KB
/
Copy pathContainerfile
File metadata and controls
50 lines (39 loc) · 1.17 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
FROM almalinux:10-minimal
RUN microdnf update -y && \
microdnf install -y \
wget \
git \
tar \
gzip \
unzip \
which \
vim-minimal \
iproute \
util-linux \
libcap \
rust \
cargo \
&& \
microdnf clean all
# Grant the 'ip' binary network capabilities
RUN setcap cap_net_admin+ep $(which ip)
RUN useradd -m -s /bin/bash opencode-user && \
mkdir -p /workspace && \
chown opencode-user:opencode-user /workspace
RUN wget -O /tmp/install https://opencode.ai/install && \
HOME=/opt/opencode bash /tmp/install && \
chmod 755 /opt/opencode/.opencode/bin/opencode && \
rm -f /tmp/install
ARG GO_VERSION=go1.26.3
RUN wget -P /tmp https://go.dev/dl/${GO_VERSION}.linux-amd64.tar.gz && \
rm -rf /usr/local/go && \
tar -C /usr/local -xzf /tmp/${GO_VERSION}.linux-amd64.tar.gz && \
rm /tmp/${GO_VERSION}.linux-amd64.tar.gz
ENV GOPATH="/tmp/go"
ENV GOCACHE="/tmp/go/cache"
ENV GOMODCACHE="/tmp/go/modcache"
ENV PATH="/usr/local/go/bin:/opt/opencode/.opencode/bin:${PATH}"
COPY --chmod=755 entrypoint.sh /usr/local/bin/entrypoint.sh
WORKDIR /workspace
USER opencode-user
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]