Skip to content

Commit

Permalink
chore: add openhands support
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFlurry committed Jan 22, 2025
1 parent e2a105a commit 80cec50
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docker/workspace/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM debian:12.9

RUN apt-get update && apt-get install -y \
curl \
sudo \
xz-utils \
&& rm -rf /var/lib/apt/lists/*

RUN echo '#!/bin/bash\nexec nix-shell /app/shell.nix "$@"' > /usr/local/bin/nix-shell-wrapper && chmod +x /usr/local/bin/nix-shell-wrapper

RUN useradd -m nixuser && echo "nixuser ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/nixuser

USER nixuser

RUN curl -vL https://nixos.org/nix/install | sh

ENV USER nixuser
ENV PATH /home/nixuser/.nix-profile/bin:/home/nixuser/.nix-profile/sbin:/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:$PATH
ENV NIX_PATH /nix/var/nix/profiles/per-user/nixuser/channels

WORKDIR /app

COPY --chown=nixuser:nixuser shell.nix /app/

RUN nix-shell shell.nix --run "true"

ENTRYPOINT ["/usr/local/bin/nix-shell-wrapper"]

2 changes: 2 additions & 0 deletions docker/workspace/Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!shell.nix
15 changes: 15 additions & 0 deletions scripts/ai/run_openhands.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

# TODO: build image
# TODO: connect image

docker run -it --rm --pull=always \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.20-nikolaik \
-e LOG_ALL_EVENTS=true \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ~/.openhands-state:/.openhands-state \
-p 3500:3000 \
--add-host host.docker.internal:host-gateway \
--name rivet-openhands \
docker.all-hands.dev/all-hands-ai/openhands:0.20

0 comments on commit 80cec50

Please sign in to comment.