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

Using existing docker images? #502

Open
de-code opened this issue Oct 18, 2018 · 5 comments
Open

Using existing docker images? #502

de-code opened this issue Oct 18, 2018 · 5 comments

Comments

@de-code
Copy link

de-code commented Oct 18, 2018

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

@tailhook
Copy link
Owner

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.

@de-code
Copy link
Author

de-code commented Oct 24, 2018

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

@ghost
Copy link

ghost commented Sep 27, 2019

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?

@tailhook
Copy link
Owner

Something along the lines of:

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

@ghost
Copy link

ghost commented Sep 29, 2019

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.

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

No branches or pull requests

2 participants