github.com/containers/podman/v5@v5.1.0-rc1/test/apiv2/14-commit.at (about)

     1  # Create a container for testing the container initializing later
     2  podman create -t -i --name myctr $IMAGE ls
     3  
     4  config=$(mktemp -t config.XXXXXXXXXX.json)
     5  cat > "$config" <<- EOF
     6  {
     7    "Entrypoint": ["/bin/crash"],
     8    "Cmd": ["and", "burn"],
     9    "Labels": {"for": "ever", "and": "ever"}
    10  }
    11  EOF
    12  
    13  # Create a new image based on the container
    14  t POST 'libpod/commit?container=myctr&repo=nativeimage&tag=1' $config 200
    15  
    16  # Check some things
    17  t GET libpod/images/nativeimage:1/json 200 ".Config.Cmd=$(jq .Cmd $config)" ".Config.Entrypoint=$(jq .Entrypoint $config)"
    18  
    19  # Create a new image based on the container
    20  t POST 'commit?container=myctr&repo=compatimage&tag=1' $config 201
    21  
    22  # Check some things
    23  t GET images/compatimage:1/json 200 ".Config.Cmd=$(jq .Cmd $config)" ".Config.Entrypoint=$(jq .Entrypoint $config)"
    24  
    25  # Clean up
    26  t DELETE containers/myctr 204
    27  t DELETE images/nativeimage:1 200
    28  t DELETE images/compatimage:1 200
    29  rm -f "$config"
    30  unset config