3 ms·
In the container context, the Go runtime gets in the way of namespace control; 'Docker' as in RunC uses C to work around this (last time I looked) and so is com
by richardjennings 6y ago
In the container context, the Go runtime gets in the way of namespace control; 'Docker' as in RunC uses C to work around this (last time I looked) and so is compiled with cgo. I'm not sure that the direct creation/control of a container is possible using just Go. I would love to be out of date and wrong!?
- pjmlp 6y agoAt some level one needs to provide bindings to the underlying OS APIs. Naturally C doesn't need bindings, when the OS APIs are written in C.
- richardjennings 6y agoThe particular implementation detail I was referring to: https://github.com/opencontainers/runc/tree/master/libcontainer/nsenter https://github.com/opencontainers/runc/tree/master/libcontai... The distinction I was attempting to make is whether or not C source code is required in your Go project to fully implement a container runtime.
- pjmlp 6y agoHow do you propose to implement bindings to Linux APIs, written in C?
- richardjennings 6y agoFrom Go? There is the syscall package. More generally C is just adding some conventions, like 'calling' that can be interacted with by following the rules from e.g assembly or a higher level language that can compile to compatible calls.
- pjmlp 6y agoFair enough, I forgot about that one.