Skip to content

Commit 0e2e47d

Browse files
committed
feat: add the ability to send arguments to podman
1 parent 191c9f8 commit 0e2e47d

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,12 @@ Need to add packages to the container, or run an init script? no problem
4141
--apk-packages foo,bar,baz # adds packages foo, bar, baz, with apk
4242
--init-script ./foobar.sh # copies foobar.sh into the container and executes it as root
4343
```
44+
45+
46+
For example, let's say you're using kubernetes and you do want claude to be able to troubleshoot it.
47+
48+
```sh
49+
claude-podman \
50+
--apk-packages kubectl \
51+
--podman-arg "-v $HOME/.kube/config:/home/claude/.kube/config"
52+
```

bin/claude

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ IMAGE="ghcr.io/evancarroll/claude-podman/claude-code:latest"
55
NAME="claudecode-$(uuidgen -r | cut -d- -f1)"
66
INIT_SCRIPT=""
77
APK_PACKAGES=""
8+
PODMAN_ARGS=""
89

910
# Process arguments
1011
while [[ $# -gt 0 ]]; do
@@ -19,6 +20,7 @@ while [[ $# -gt 0 ]]; do
1920
--local Use local image 'claude-code:latest' instead of remote
2021
--init-script FILE Execute initialization script
2122
--apk-packages LIST Install additional Alpine packages (comma or space separated)
23+
--podman-arg ARG Pass additional argument to podman
2224
--help Display this help message
2325
EOT
2426
exit 0
@@ -35,6 +37,10 @@ while [[ $# -gt 0 ]]; do
3537
APK_PACKAGES="$2"
3638
shift 2
3739
;;
40+
--podman-arg)
41+
PODMAN_ARGS="$PODMAN_ARGS $2"
42+
shift 2
43+
;;
3844
*)
3945
break
4046
;;
@@ -52,6 +58,7 @@ podman run \
5258
--detach \
5359
--user claude \
5460
--userns=keep-id:uid=1001,gid=1001 \
61+
$PODMAN_ARGS \
5562
"$IMAGE" "$@"
5663

5764
if [ -n "$APK_PACKAGES" ]; then
@@ -64,3 +71,4 @@ if [ -n "$INIT_SCRIPT" ]; then
6471
fi
6572

6673
podman container attach "$NAME"
74+

0 commit comments

Comments
 (0)