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

examples: add {docker,podman,singularity}.yaml #210

Merged
merged 1 commit into from
Sep 8, 2021

Conversation

AkihiroSuda
Copy link
Member

@AkihiroSuda AkihiroSuda commented Sep 5, 2021

Docker, Podman, Singularity, or whatever can be used instead of the default containerd/nerdctl .

LXD can be used too, of course, but there is no lxd.yaml, because LXD is included in the default Ubuntu image.

Example usage:

$ limactl start ./docker.yaml
$ limactl shell docker docker run -it --rm -v $HOME:$HOME alpine
$ limactl start ./podman.yaml
$ limactl shell podman podman run -it --rm -v $HOME:$HOME:ro docker.io/library/alpine
$ limactl start ./singularity.yaml
$ limactl shell singularity singularity run -u -B $HOME:$HOME docker://alpine

docker CLI on macOS can connect to dockerd inside the guest VM as well: DOCKER_HOST=ssh://127.0.0.1:60006 docker run -it --rm -v $HOME:$HOME alpine .

This requires NoHostAuthenticationForLocalhost yes in ~/.ssh/config. (Alternatively you can just login to ssh -p 60006 127.0.0.1 to initialize ~/.ssh/known_hosts)

@AkihiroSuda AkihiroSuda added the documentation Improvements or additions to documentation label Sep 5, 2021
@AkihiroSuda AkihiroSuda added this to the v0.6.4 milestone Sep 5, 2021
@AkihiroSuda AkihiroSuda force-pushed the more-examples branch 7 times, most recently from e223f07 to dd8f327 Compare September 6, 2021 14:41
Docker, Podman, Singularity, or whatever can be used instead of the
default containerd/nerdctl .

LXD can be used too, of course, but there is no `lxd.yaml`, because LXD
is included in the default Ubuntu image.

Example usage:
```
$ limactl start ./docker.yaml
$ limactl shell docker docker run -it --rm -v $HOME:$HOME alpine
```

```
$ limactl start ./podman.yaml
$ limactl shell podman podman run -it --rm -v $HOME:$HOME:ro docker.io/library/alpine
```

```
$ limactl start ./singularity.yaml
$ limactl shell singularity singularity run -u -B $HOME:$HOME docker://alpine
```

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
@csantanapr
Copy link

podman on macos doesn't support volumes -v so this solution would be perfect.

@jandubois
Copy link
Member

The DOCKER_HOST=... examples only work when rebasing on top of #220. Sorry about the breakage! 😞

I suspect there are various ways this could also be broken by .ssh/config settings. I think we should support forwarding sockets in addition to ports from the host agent; that way it could even be linked to the default socket location. See e.g. https://github.com/abiosoft/colima/blob/main/colima#L151

I've tried all the sample commands, and they all work for me.

Have not yet found time to review the example files themselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker documentation Improvements or additions to documentation impact/changelog podman
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants