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

Introduction for beginners? #154

Closed
onlyjob opened this issue Nov 4, 2019 · 15 comments
Closed

Introduction for beginners? #154

onlyjob opened this issue Nov 4, 2019 · 15 comments

Comments

@onlyjob
Copy link

onlyjob commented Nov 4, 2019

I'm struggling to learn how to use Crun. Is there an intro with examples how to run a container, etc.?

Thanks.

@giuseppe
Copy link
Member

giuseppe commented Nov 4, 2019

The easiest way would probably be to use crun through a container engine such as Podman or CRI-O if you care about Kubernetes. FAIK, there is some work in progress for supporting crun also in containerd and in Moby/Docker.
I
If you'd like to use it directly, then you need a container image exploded on disk and already usable by crun since crun doesn't do any storage management.

Assuming you have a container image at rootfs, you can create a config file with crun spec:

$ ls -1
config.json
rootfs

At this point, you can tweak config.json with the configuration you wish.

I'd still suggest though to use it through a higher level tool as you won't have to worry about storage, or setup a network namespace beforehand

@onlyjob
Copy link
Author

onlyjob commented Nov 4, 2019

Interesting. Thank you. I think this information belongs to README to make it clear how Crun is expected to be used.

So how to use Crun with Podman, specifically? Is it documented anywhere?

@giuseppe
Copy link
Member

giuseppe commented Nov 4, 2019

in the Podman man page there is some info on how to configure and use a different OCI runtime:

https://github.com/containers/libpod/blob/master/docs/source/markdown/podman.1.md

@onlyjob
Copy link
Author

onlyjob commented Nov 4, 2019

Thank you.

It is quite easy to plug Crun to Podman by having the following in the /etc/containers/libpod.conf:

runtime = "crun"

[runtimes]
crun = [
    "/usr/bin/crun"
]

@giuseppe
Copy link
Member

giuseppe commented Nov 4, 2019

thanks for confirming it works for you. Can we close the issue?

@onlyjob
Copy link
Author

onlyjob commented Nov 4, 2019

I was hoping for some changes to README - just a few words about how to use Crun with Podman and a few words that Crun is a replacement to Runc rather than an alternative to rkt, Docker, etc...

@giuseppe
Copy link
Member

giuseppe commented Nov 4, 2019

I was hoping for some changes to README - just a few words about how to use Crun with Podman and a few words that Crun is a replacement to Runc rather than an alternative to rkt, Docker, etc...

yes that sounds like a good idea. Would you mind to open a PR with these improvements for the README file? I'll be happy to review it

@warmchang
Copy link

Hi, could you tell us what is the roadmap of crun project? It will replace the runc as the default runtime component in openshift?

@rhatdan
Copy link
Member

rhatdan commented Mar 6, 2020

@warmchang We have not made any decisions on that, at this point. Originally crun was for support for cgroupV2, but it also has some interesting features that runc does not, and @giuseppe is looking into adding additional features.

@rhatdan
Copy link
Member

rhatdan commented Mar 6, 2020

@onlyjob @giuseppe Should we update the readme and/or close this issue?

@warmchang
Copy link

@rhatdan I got it, and thank you for reply.

@onlyjob
Copy link
Author

onlyjob commented Mar 7, 2020

I would love to see some changes to README please, as requested here: #154 (comment)

Thanks.

@giuseppe
Copy link
Member

giuseppe commented Mar 7, 2020

I would love to see some changes to README please, as requested here: #154 (comment)

could you open a PR with the changes you'd like to add?

@rhatdan
Copy link
Member

rhatdan commented Sep 30, 2020

Since no PR was generated I am going to close.

@rhatdan rhatdan closed this as completed Sep 30, 2020
@warmchang
Copy link

@warmchang We have not made any decisions on that, at this point. Originally crun was for support for cgroupV2, but it also has some interesting features that runc does not, and @giuseppe is looking into adding additional features.

https://docs.openshift.com/container-platform/4.12/nodes/containers/nodes-containers-using.html#nodes-containers-runtimes
It seems to be working in this direction. 😄

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

4 participants