Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildah mount locations not visible to the host #1814

Closed
gireeshpunathil opened this issue Aug 22, 2019 · 6 comments
Closed

buildah mount locations not visible to the host #1814

gireeshpunathil opened this issue Aug 22, 2019 · 6 comments

Comments

@gireeshpunathil
Copy link

Description

Steps to reproduce the issue:

  1. Get into quay.io/builda container, with a mount:
    docker run --privileged -it -v /a:/b -v containers:/var/lib/containers quay.io/buildah/stable /bin/sh

  2. Create something under the mount
    echo hello > /b/foo.txt

  3. Create a container from scratch, with the mount forwarding to the child
    buildah from --name cont -v /b:/c scratch

  4. Get the mount point of the chile
    mount=``buildah mount cont`

  5. Check the content of the mount point:
    ls -lrt $mount/
    Describe the results you received:

I got total 0

Describe the results you expected:

I expected:
-rw-r--r-- 1 root root 6 Aug 22 13:56 foo.txt or similar
Output of rpm -q buildah or apt list buildah:

I have tried several mount options such as :shared etc. but did not succeed.

If I run buildah run on the container and get in, I can see the mount points properly - which indicates the mount, and its access permissions, visibility and share-ability are all good.

buildah-1.9.2-2.fc30.x86_64

Output of buildah version:

Version:         1.9.2
Go Version:      go1.12.7
Image Spec:      1.0.1
Runtime Spec:    1.0.1-dev
CNI Spec:        0.4.0
libcni Version:  
Git Commit:      
Built:           Thu Jan  1 00:00:00 1970
OS/Arch:         linux/amd64

Output of podman version if reporting a podman build issue:

(paste your output here)

Output of cat /etc/*release:

Fedora release 30 (Thirty)

Output of uname -a:

Linux a9cebbb7863d 4.9.184-linuxkit #1 SMP Tue Jul 2 22:58:16 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Output of cat /etc/containers/storage.conf:

driver = "overlay"
runroot = "/var/run/containers/storage"
graphroot = "/var/lib/containers/storage"

[storage.options]
additionalimagestores = [
"/var/lib/shared",
]
size = ""
mount_program = "/usr/bin/fuse-overlayfs"
override_kernel_check = "true"
mountopt = "nodev,metacopy=on"
[storage.options.thinpool]
ostree_repo = ""
skip_mount_home = "false"

Thanks in advance!

@rhatdan
Copy link
Member

rhatdan commented Aug 22, 2019

This definitely looks like a bug. @TomSweeneyRedHat PTAL

@rhatdan
Copy link
Member

rhatdan commented Aug 29, 2019

So the volumes are only getting mounted during a RUN or Build. The issue is we rely on the OCI runtime to actually create the content and mount the bind mounts.

@TomSweeneyRedHat
Copy link
Member

@rhatdan is there something we can do with this? I'm not sure this is unexpected for the mount command as it's used in the example.

@rhatdan
Copy link
Member

rhatdan commented Sep 4, 2019

Yes I think we need to close this since we really can not fix this is a reasonable way other then to tell user to run the container

As soon as you do a
buildah run $CTR echo hello
The mount point point will change.

@rhatdan
Copy link
Member

rhatdan commented Sep 4, 2019

We could document this though.

@gireeshpunathil
Copy link
Author

I will close this out in favor of #1821 , as I guess we are talking about the same thing or the underlying issue is one and the same, and #1821 has more context.

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants