Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions dev/opencode/Dockerfile-opencode
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM ubuntu:26.04
ARG UID=1000
ARG GID=1000

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
git curl sudo

RUN groupadd -g $GID -o opencode
RUN userdel -f ubuntu
RUN useradd -ms /bin/bash -u $UID -g $GID opencode

USER opencode
RUN mkdir /home/opencode/code
RUN curl -fsSL https://opencode.ai/install | bash
WORKDIR /home/opencode

## copy local permissions over
COPY ./opencode.json /home/opencode/.config/opencode/opencode.json
COPY ./auth.json /home/opencode/.local/share/opencode/auth.json

USER root
RUN chown -R opencode:opencode /home/opencode/.config/ /home/opencode/.local/

CMD ["/bin/bash"]
11 changes: 11 additions & 0 deletions dev/opencode/create-docker-opencode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash -e

cd $(dirname $0)

cp $HOME/.config/opencode/opencode.json .
cp $HOME/.local/share/opencode/auth.json .

docker build -t gwdg-opencode:last -f Dockerfile-opencode --build-arg UID=$(id -u) --build-arg GID=$(id -g) --progress plain .

rm opencode.json auth.json

4 changes: 4 additions & 0 deletions dev/opencode/run-docker-opencode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash -e
cd $(dirname $0)

docker run -it --rm --user $(id -u):$(id -g) -v $PWD/../../:/home/opencode/code gwdg-opencode:last