安装containerd

root@ubuntu:~/kata# go get github.com/containerd/containerd
root@ubuntu:~/kata# pt-get install btrfs-tools

Command 'pt-get' not found, did you mean:

  command 'apt-get' from deb apt

Try: apt install <deb name>

root@ubuntu:~/kata# apt-get install btrfs-toolas
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package btrfs-toolas
root@ubuntu:~/kata# apt-get install btrfs-progs libbtrfs-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libbtrfs-dev
root@ubuntu:~/kata# apt-get install btrfs-progs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
btrfs-progs is already the newest version (4.15.1-1build1).
The following packages were automatically installed and are no longer required:
  golang-1.10-go golang-1.10-src golang-src
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 160 not upgraded.
root@ubuntu:~/kata# cd $GOPATH/src/github.com/containerd/containerd
root@ubuntu:/opt/gopath/src/github.com/containerd/containerd# make
+ bin/ctr
+ bin/containerd
+ bin/containerd-stress
+ bin/containerd-shim
+ bin/containerd-shim-runc-v1
+ bin/containerd-shim-runc-v2
+ binaries
root@ubuntu:/opt/gopath/src/github.com/containerd/containerd# make install
+ install bin/ctr bin/containerd bin/containerd-stress bin/containerd-shim bin/containerd-shim-runc-v1 bin/containerd-shim-runc-v2
root@ubuntu:/opt/gopath/src/github.com/containerd/containerd# whereis containerd
containerd: /usr/local/bin/containerd
root@ubuntu:/opt/gopath/src/github.com/containerd/containerd# /usr/local/bin/containerd -version
containerd github.com/containerd/containerd v1.4.0-113-g4a6b47d4 4a6b47d470d9f2dfc3d49f2819b968861dfa123e
root@ubuntu:/opt/gopath/src/github.com/containerd/containerd# 
mkdir -p /etc/containerd
cp  ~/container.toml /etc/containerd
containerd config default > /etc/containerd/config.toml
systemctl restart containerd

touch /etc/systemd/system/containerd.service
# Copyright The containerd Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

[Unit]
Description=containerd container runtime
Documentation=https://containerd.io
After=network.target local-fs.target

[Service]
ExecStartPre=-/sbin/modprobe overlay
ExecStart=/usr/local/bin/containerd

Type=notify
Delegate=yes
KillMode=process
Restart=always
RestartSec=5
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNPROC=infinity
LimitCORE=infinity
LimitNOFILE=infinity
# Comment TasksMax if your systemd version does not supports it.
# Only systemd 226 and above support this version.
TasksMax=infinity
OOMScoreAdjust=-999

[Install]
WantedBy=multi-user.target
原文地址:https://www.cnblogs.com/dream397/p/13822760.html