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