opencontainers / runc

CLI tool for spawning and running containers according to the OCI specification
https://www.opencontainers.org/
Apache License 2.0
11.58k stars 2.06k forks source link

refactor: move some c code to go #4309

Open lifubang opened 4 weeks ago

lifubang commented 4 weeks ago

As mentioned in #3951 , we want to move c code to golang, there are many hard works to do.

This PR has done the first step, move all the stage-1 c code and some of the stage-2 c code to go code, because they are not related to namespaces, they should be implemented by golang.

This refactor brings one benifit, it reduces one process clone when start/run/create a container. But because the stage-1 c code is hard to move to go code, so it brings a Complexity for libct/nsenter, for example, it's hard to write unit tests for nsenter.

Welcome more suggestions.