File: 14-commit.at

package info (click to toggle)
podman 5.7.0%2Bds2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 23,824 kB
  • sloc: sh: 4,700; python: 2,798; perl: 1,885; ansic: 1,484; makefile: 977; ruby: 42; csh: 8
file content (30 lines) | stat: -rw-r--r-- 937 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Create a container for testing the container initializing later
podman create -t -i --name myctr $IMAGE ls

config=$(mktemp -t config.XXXXXXXXXX.json)
cat > "$config" <<- EOF
{
  "Entrypoint": ["/bin/crash"],
  "Cmd": ["and", "burn"],
  "Labels": {"for": "ever", "and": "ever"}
}
EOF

# Create a new image based on the container
t POST 'libpod/commit?container=myctr&repo=nativeimage&tag=1' $config 200

# Check some things
t GET libpod/images/nativeimage:1/json 200 ".Config.Cmd=$(jq .Cmd $config)" ".Config.Entrypoint=$(jq .Entrypoint $config)"

# Create a new image based on the container
t POST 'commit?container=myctr&repo=compatimage&tag=1' $config 201

# Check some things
t GET images/compatimage:1/json 200 ".Config.Cmd=$(jq .Cmd $config)" ".Config.Entrypoint=$(jq .Entrypoint $config)"

# Clean up
t DELETE containers/myctr 204
t DELETE images/nativeimage:1 200
t DELETE images/compatimage:1 200
rm -f "$config"
unset config