vagga icon indicating copy to clipboard operation
vagga copied to clipboard

Using existing docker images?

Open de-code opened this issue 7 years ago • 5 comments

Is it possible to use / run existing docker images or do they always have to be built separately using vagga?

de-code avatar Oct 18 '18 19:10 de-code

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.

tailhook avatar Oct 22 '18 11:10 tailhook

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).

de-code avatar Oct 24 '18 17:10 de-code

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?

ghost avatar Sep 27 '19 19:09 ghost

Something along the lines of:

containers:
  fedora:
    setup:
    - !Tar
    url: ./fedora.tar
    path: /

tailhook avatar Sep 29 '19 12:09 tailhook

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.

ghost avatar Sep 29 '19 20:09 ghost