This commit is contained in:
Jaroslaw Konik 2026-05-14 18:05:00 +02:00
parent b03f9c0812
commit 1ff13a8f4a

27
agent
View file

@ -36,8 +36,8 @@ case "$app" in
npm_pkg="@anthropic-ai/claude-code" npm_pkg="@anthropic-ai/claude-code"
cmd="claude" cmd="claude"
extra_volumes=( extra_volumes=(
-v "$HOME/.claude:/root/.claude" -v "$HOME/.claude:$HOME/.claude"
-v "$HOME/.claude.json:/root/.claude.json" -v "$HOME/.claude.json:$HOME/.claude.json"
) )
;; ;;
opencode) opencode)
@ -45,10 +45,10 @@ case "$app" in
npm_pkg="opencode-ai" npm_pkg="opencode-ai"
cmd="opencode" cmd="opencode"
extra_volumes=( extra_volumes=(
-v "$HOME/.config/opencode:/root/.config/opencode" -v "$HOME/.config/opencode:$HOME/.config/opencode"
-v "$HOME/.local/share/opencode:/root/.local/share/opencode" -v "$HOME/.local/share/opencode:$HOME/.local/share/opencode"
-v "$HOME/.local/state/opencode:/root/.local/state/opencode" -v "$HOME/.local/state/opencode:$HOME/.local/state/opencode"
-v "$HOME/.claude:/root/.claude" # allow access to claude config for hacked auth -v "$HOME/.claude:$HOME/.claude" # allow access to claude config for hacked auth
) )
;; ;;
*) *)
@ -65,15 +65,16 @@ case "$env" in
;; ;;
rust) rust)
env_suffix="-rust" env_suffix="-rust"
env_layer='RUN curl --proto '"'"'=https'"'"' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y env_layer='ENV RUSTUP_HOME=/opt/rust/rustup CARGO_HOME=/opt/rust/cargo PATH=/opt/rust/cargo/bin:${PATH}
ENV PATH="/root/.cargo/bin:${PATH}"' RUN curl --proto '"'"'=https'"'"' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path && chmod -R a+rwX /opt/rust'
;; ;;
rust-esp32) rust-esp32)
env_suffix="-rust-esp32" env_suffix="-rust-esp32"
env_layer='RUN curl --proto '"'"'=https'"'"' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y env_layer='ENV RUSTUP_HOME=/opt/rust/rustup CARGO_HOME=/opt/rust/cargo PATH=/opt/rust/cargo/bin:${PATH}
ENV PATH="/root/.cargo/bin:${PATH}" RUN curl --proto '"'"'=https'"'"' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path
RUN cargo install espup && espup install RUN cargo install espup && espup install --export-file /opt/rust/export-esp.sh
RUN printf '"'"'#!/bin/bash\n. /root/export-esp.sh\nexec "$@"\n'"'"' > /entrypoint.sh && chmod +x /entrypoint.sh RUN chmod -R a+rwX /opt/rust
RUN printf '"'"'#!/bin/bash\n. /opt/rust/export-esp.sh\nexec "$@"\n'"'"' > /entrypoint.sh && chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]' ENTRYPOINT ["/entrypoint.sh"]'
;; ;;
*) *)
@ -98,6 +99,8 @@ clear
docker run -it --rm \ docker run -it --rm \
--name "${image_name}-container" \ --name "${image_name}-container" \
--user "$(id -u):$(id -g)" \
-e HOME="$HOME" \
-v "$workspace:/workspace" \ -v "$workspace:/workspace" \
"${extra_volumes[@]}" \ "${extra_volumes[@]}" \
-w /workspace \ -w /workspace \