RunpodR
Runpod2y ago
Miceo

runpodctl not found on pod

I wanted to run some tests. This involves a pod stopping itself after executing a task. To do this, I execute some work and then call runpodctl stop pod $RUNPOD_POD_ID inside the container from a bash script. This works in my actual production container, but it doesn't work in my test environment. The pod says that runpodctl can't be found (2024-06-11T13:56:58.504874269Z ./run.sh: line 11: runpodctl: not found). Even after letting it run for a while, it can't ever find runpodctl. Any idea what I can do about this?

Here's a very minimal Dockerfile:
FROM alpine 
COPY . .
RUN chmod +x run.sh
ENTRYPOINT ["./run.sh"]


and the contents of run.sh:
#!/bin/sh

# wait for 10 seconds
for i in $(seq 20 -1 0); do
    echo $i
    sleep 1
done

# stop the pod
echo "Stopping the pod"
runpodctl stop pod $RUNPOD_POD_ID


cheers.
Solution
runpodctl won't be installed on the alpine image by default
Was this page helpful?