Outils pour utilisateurs

Outils du site


tech:notes_podman_api

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

tech:notes_podman_api [2025/12/15 10:04] – créée Jean-Baptistetech:notes_podman_api [2026/03/24 16:54] (Version actuelle) Jean-Baptiste
Ligne 1: Ligne 1:
 +<!DOCTYPE markdown>
 +{{tag>Brouillon Podman Conteneur REST API HTTP}}
 +
 +# Notes podman api
 +
 +Source : https://github.com/containers/podman/issues/15377
 +
 +Launch a long running container
 +~~~bash
 +podman run -d ubi8/ubi:latest /usr/bin/sleep 999
 +~~~
 +
 +Obtain the container ID
 +~~~
 +$ podman ps -l --format "{{.ID}}"
 +3d806b972a91
 +~~~
 +
 +Launch an exec
 +~~~bash
 +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}'
 +~~~
 +
 +
 +FIXME
 +
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki