vagga
vagga copied to clipboard
Using existing docker images?
Is it possible to use / run existing docker images or do they always have to be built separately using vagga?
Hi,
You can't run existing docker images "by name" in vagga. But you don't have to build by vagga. You can do run "docker export" to save a file with a filesystem image and the result of that command using !Tar.
We're thinking about fetching images directly from docker hub, but have not implement it yet.
Thank you for that. I tried that today but I think it's failing before it even gets to try to load the image (#503).
This would be a killer feature. Could you provide an example? I'm having trouble understanding the documentation for !Tar. Say I have a file fedora.tar exported from Docker in my local dir... What would I need in my .vagga.yaml?
Something along the lines of:
containers:
fedora:
setup:
- !Tar
url: ./fedora.tar
path: /
Great, thanks! I'm getting the following error right now:
ERROR 2019-09-29T20:04:44Z: vagga::wrapper: Error executing _build: volume: recursive bind mount "/home/user" -> "/home/wrycode/code/containers/fedora/.vagga/.mnt/volumes/home": No such file or directory (os error 2) (source: missing, target: exists, mapped-root)
Command <Command "/proc/self/exe" "__wrapper__" "_build" "fedora"; environ[3]; uid_map=[UidMap { inside_uid: 0, outside_uid: 1000, count: 1 }, UidMap { inside_uid: 1, outside_uid: 100000, count: 65535 }]; gid_map=[GidMap { inside_gid: 0, outside_gid: 998, count: 1 }, GidMap { inside_gid: 1, outside_gid: 100000, count: 65535 }]> exited with code 124
I tried it with a Debian archive as well and got the same error. My vagga.yaml looks like this:
containers:
fedora:
setup:
- !Tar
url: ./fedora.tar
path: /
commands:
bash: !Command
description: Run bash shell inside the container
container: fedora
run: /bin/bash
It looks like it might be trying to enter the container as user instead of root, maybe? I tried adding - !Env HOME: /root to the setup but the errors didn't change.