Last active
May 10, 2025 14:55
-
-
Save dims/936f5ddd85e94ea588781f1570860c2d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat > ubuntu-pod.json <<EOF | |
{ | |
"metadata": { | |
"name": "ubuntu-sandbox", | |
"namespace": "default", | |
"attempt": 1, | |
"uid": "ubuntu-pod-uid" | |
}, | |
"logDirectory": "/tmp", | |
"linux": {} | |
} | |
EOF | |
cat > ubuntu-container.json <<EOF | |
{ | |
"metadata": { | |
"name": "ubuntu-container" | |
}, | |
"image": { | |
"image": "ubuntu:latest" | |
}, | |
"command": [ | |
"sleep", | |
"infinity" | |
], | |
"log_path": "ubuntu-container.log", | |
"linux": {} | |
} | |
EOF | |
POD_ID=$(crictl runp ubuntu-pod.json) | |
CONTAINER_ID=$(crictl create $POD_ID ubuntu-container.json ubuntu-pod.json) | |
crictl start $CONTAINER_ID | |
crictl images | |
crictl pods | |
crictl ps | |
crictl exec $CONTAINER_ID ls / | |
crictl stopp $POD_ID | |
crictl rmp $POD_ID | |
crictl pods | |
crictl ps |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment