简体   繁体   中英

Where is the code of containerd/runc in docker-ce?

I am trying to debug docker (including everything, docker, dockerd, containerd, runc ), and have cloned source code from github/docker/docker-ce .

Now I can locate the source code of:

  • docker (docker-cli): at components/cli
  • dockerd : at components/engine/daemon

in repo of docker-ce and successfully make them.

But I cannot find the code of containerd and runc in docker-ce repo, while there are binaries of them when make command is triggered.

So where the binaries come from?

I know there are repos of containerd and runc .

Here's my own findings from a quick scan. The Makefile for components/engine includes various steps, including a docker build.

The Dockerfile includes sections for containerd and runc:

FROM base AS containerd
RUN apt-get update && apt-get install -y btrfs-tools
ENV INSTALL_BINARY_NAME=containerd
COPY hack/dockerfile/install/install.sh ./install.sh
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
RUN PREFIX=/build/ ./install.sh $INSTALL_BINARY_NAME

FROM runtime-dev AS runc
ENV INSTALL_BINARY_NAME=runc
COPY hack/dockerfile/install/install.sh ./install.sh
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
RUN PREFIX=/build/ ./install.sh $INSTALL_BINARY_NAME

Then in the hack folder for the dockerfile, there are scripts to install containerd and runc .

These scripts clone the repo and checkout specific commits from containerd and runc 's upstream repos.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM