tech:notes_podman_api
Notes podman api
Source : https://github.com/containers/podman/issues/15377
Launch a long running container
podman run -d ubi8/ubi:latest /usr/bin/sleep 999
Obtain the container ID
$ podman ps --format "{{.ID}}"
3d806b972a91
Launch an exec
CONTAINER_ID=3d806b972a91 PODMAN_SOCKET=/run/user/$(id -u)/podman/podman.sock EXEC_ID=$(curl -X POST -s --unix-socket "$PODMAN_SOCKET" -H 'Content-Type: application/json' "http://d/v1.0.0/libpod/containers/$CONTAINER_ID/exec" -d '{"Cmd": ["/usr/bin/sleep", "2"], "AttachStdout": true}' | jq -r '.Id' ) curl -X POST --unix-socket "$PODMAN_SOCKET" -H 'Content-Type: application/json' "http://d/v1.0.0/libpod/exec/$EXEC_ID/start" -d '{"Detatch": false}'
tech/notes_podman_api.txt · Dernière modification : de Jean-Baptiste
