podman

Форк
0
/
14-commit.at 
30 строк · 937.0 Байт
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
31

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.