mirror of
https://github.com/containers/skopeo.git
synced 2026-07-14 05:21:15 +00:00
Accept commit target names which don't include a transport name by checking if they parse as valid containers-storage references after they fail to parse as a general reference. Signed-off-by: Nalin Dahyabhai <nalin@redhat.com> Closes: #49 Approved by: rhatdan
2.1 KiB
Executable File
2.1 KiB
Executable File
#!/bin/bash -x
set -e
read
export PATH=`pwd`:$PATH
systemctl restart ocid
read
: " Check if we have some images to work with."
ocic image list
read
: " Create a working container, and capture its name "
read
echo '[container1=`buildah from ${1:-ubuntu}`]'
container1=`buildah from ${1:-ubuntu}`
read
: " Mount that working container, and capture the mountpoint "
read
echo '[mountpoint1=`buildah mount $container1`]'
mountpoint1=`buildah mount $container1`
read
: " Add a file to the container "
read
echo '[echo yay > $mountpoint1/file-in-root]'
echo yay > $mountpoint1/file-in-root
read
: " Produce an image from the container "
read
buildah commit "$container1" containers-storage:${2:-first-new-image}
read
: " Verify that our new image is there "
read
ocic image list
read
: " Unmount our working container and delete it "
read
buildah umount "$container1"
buildah rm "$container1"
read
: " Now try it with ocid not running! "
read
systemctl stop ocid
read
: " You know what? Go ahead and use that image we just created, and capture its name "
read
echo '[container2=`buildah from ${2:-first-new-image}`]'
container2=`buildah from ${2:-first-new-image}`
read
: " Mount that new working container, and capture the mountpoint "
read
echo '[mountpoint2=`buildah mount $container2`]'
mountpoint2=`buildah mount $container2`
read
: " That file we added to the image is there, right? "
read
cat $mountpoint2/file-in-root
read
: " Add a file to the new container"
read
echo '[echo yay > $mountpoint2/another-file-in-root]'
echo yay > $mountpoint2/another-file-in-root
read
: " Produce an image from the new container"
read
buildah commit "$container2" ${3:-second-new-image}
read
: " Unmount our new working container and delete it "
read
buildah umount "$container2"
buildah rm "$container2"
read
: " Verify that our new new image is there"
read
systemctl start ocid
ocic image list
read
: " Clean up, because I ran this like fifty times while testing "
read
ocic image remove --id=${2:-first-new-image}
ocic image remove --id=${3:-second-new-image}
set -e
read
export PATH=`pwd`:$PATH
systemctl restart ocid
read
: " Check if we have some images to work with."
ocic image list
read
: " Create a working container, and capture its name "
read
echo '[container1=`buildah from ${1:-ubuntu}`]'
container1=`buildah from ${1:-ubuntu}`
read
: " Mount that working container, and capture the mountpoint "
read
echo '[mountpoint1=`buildah mount $container1`]'
mountpoint1=`buildah mount $container1`
read
: " Add a file to the container "
read
echo '[echo yay > $mountpoint1/file-in-root]'
echo yay > $mountpoint1/file-in-root
read
: " Produce an image from the container "
read
buildah commit "$container1" containers-storage:${2:-first-new-image}
read
: " Verify that our new image is there "
read
ocic image list
read
: " Unmount our working container and delete it "
read
buildah umount "$container1"
buildah rm "$container1"
read
: " Now try it with ocid not running! "
read
systemctl stop ocid
read
: " You know what? Go ahead and use that image we just created, and capture its name "
read
echo '[container2=`buildah from ${2:-first-new-image}`]'
container2=`buildah from ${2:-first-new-image}`
read
: " Mount that new working container, and capture the mountpoint "
read
echo '[mountpoint2=`buildah mount $container2`]'
mountpoint2=`buildah mount $container2`
read
: " That file we added to the image is there, right? "
read
cat $mountpoint2/file-in-root
read
: " Add a file to the new container"
read
echo '[echo yay > $mountpoint2/another-file-in-root]'
echo yay > $mountpoint2/another-file-in-root
read
: " Produce an image from the new container"
read
buildah commit "$container2" ${3:-second-new-image}
read
: " Unmount our new working container and delete it "
read
buildah umount "$container2"
buildah rm "$container2"
read
: " Verify that our new new image is there"
read
systemctl start ocid
ocic image list
read
: " Clean up, because I ran this like fifty times while testing "
read
ocic image remove --id=${2:-first-new-image}
ocic image remove --id=${3:-second-new-image}