Skip to content

Instantly share code, notes, and snippets.

@tnk4on
Last active June 11, 2021 08:31
Show Gist options
  • Save tnk4on/87cd677bc7aac0cac7acdb9ea0b46e8b to your computer and use it in GitHub Desktop.
Save tnk4on/87cd677bc7aac0cac7acdb9ea0b46e8b to your computer and use it in GitHub Desktop.
$ cat build.sh
container=$(buildah from alpine)
mnt=$(buildah mount $container)
set -ex; mkdir -p $mnt/work; touch $mnt/work/foo
container2=$(buildah from alpine)
mnt2=$(buildah mount $container2)
set -ex;mkdir -p $mnt2/work
cp $mnt/work/foo $mnt2/work/
buildah umount $container2
buildah commit $container2 test
$ buildah unshare bash build.sh
$ podman run --rm test ls -l /work
total 0
-rw-rw-r-- 1 root root 0 Jun 11 07:59 foo
$ buildah version
Version: 1.21.0
Go Version: go1.16.3
Image Spec: 1.0.1-dev
Runtime Spec: 1.0.2-dev
CNI Spec: 0.4.0
libcni Version:
image Version: 5.12.0
Git Commit:
Built: Thu Jan 1 09:00:00 1970
OS/Arch: linux/amd64
$ podman version
Version: 3.2.0
API Version: 3.2.0
Go Version: go1.16.3
Built: Wed Jun 9 23:24:16 2021
OS/Arch: linux/amd64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment