从官网下载二进制包,解压到 /usr/local 目录。
下载链接:https://github.com/containerd/containerd/releases/download/v1.6.6/containerd-1.6.6-linux-amd64.tar.gz
root@timo:~# tar Cxzvf /usr/local containerd-1.6.6-linux-amd64.tar.gz
bin/
bin/containerd-shim
bin/containerd
bin/containerd-shim-runc-v1
bin/containerd-stress
bin/containerd-shim-runc-v2
bin/ctr
root@timo:~# ls /usr/local/bin/
containerd containerd-shim containerd-shim-runc-v1 containerd-shim-runc-v2 containerd-stress ctr
root@timo:~#
配置文件没有提供,可以通过命令手动生成。
有两处需要修改。
1、SystemdCgroup = false改为SystemdCgroup = true
2、k8s.gcr.io改为registry.aliyuncs.com/google_containers
root@timo:~# mkdir -p /etc/containerd
root@timo:~# containerd config default > /etc/containerd/config.toml
root@timo:~# sed -i "s#SystemdCgroup = false#SystemdCgroup = true#" /etc/containerd/config.toml
root@timo:~# sed -i "s#k8s.gcr.io#registry.aliyuncs.com/google_containers#" /etc/containerd/config.toml
Service启动文件也没有提供,直接从官网下载。
下载链接:https://raw.githubusercontent.com/containerd/containerd/main/containerd.service
containerd命令是存放在
/usr/local/bin目录的,如果是在别的路径,需要修改ExecStart参数。
root@timo:~# mv containerd.service /etc/systemd/system/containerd.service
root@timo:~# cat /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
root@timo:~#
上面步骤都完成就可以启动containerd了。
root@timo:~# systemctl daemon-reload
root@timo:~# systemctl enable --now containerd
Created symlink /etc/systemd/system/multi-user.target.wants/containerd.service → /etc/systemd/system/containerd.service.
root@timo:~#
root@timo:~# ss -lnpt | grep containerd
LISTEN 0 4096 127.0.0.1:38949 0.0.0.0:* users:(("containerd",pid=5195,fd=18))
root@timo:~# ps -ef | grep containerd
root 5195 1 0 12:39 ? 00:00:00 /usr/local/bin/containerd
root 5298 4480 0 12:39 pts/1 00:00:00 grep --color=auto containerd
root@timo:~#
containerd提供了个 ctr 命令可以启动容器,启动一个redis容器试试。
root@timo:~# ctr images pull docker.io/library/redis:alpine
docker.io/library/redis:alpine: resolved |++++++++++++++++++++++++++++++++++++++|
index-sha256:5916c280afae05baf0dc9a0cc82fa8e51477bdbfc72f60a5c14fd2b7735bcf07: done |++++++++++++++++++++++++++++++++++++++|
manifest-sha256:58ff33524a6664b35e50c1a243f07096eb05b479dc65e06f3592197353ca10fa: done |++++++++++++++++++++++++++++++++++++++|
layer-sha256:abe61b7e68d2f0e1b0ec8a60132416ee2a6347b65d999622e3fcdf8ef0b099c6: done |++++++++++++++++++++++++++++++++++++++|
config-sha256:f934e82c14d178bda705b7c6363b065f3fc49bcbaf7914c181b117c65c566a1e: done |++++++++++++++++++++++++++++++++++++++|
layer-sha256:2408cc74d12b6cd092bb8b516ba7d5e290f485d3eb9672efc00f0583730179e8: done |++++++++++++++++++++++++++++++++++++++|
layer-sha256:e90389148883be3c6500b090644113cf690b528e6f057515568a36bfd0b0d87c: done |++++++++++++++++++++++++++++++++++++++|
layer-sha256:c6c08b6ea4d56366e32f458bcaeb9933840882cfa4ac9073d0d42649e34d1a16: done |++++++++++++++++++++++++++++++++++++++|
layer-sha256:a1a4b4673a2365320badae5b96d7638c5901770884781d8695c8378499c72e73: done |++++++++++++++++++++++++++++++++++++++|
layer-sha256:e14aa32bdd63af41851e289cafde7077de5e474d6521ca720bbfae51e29b401d: done |++++++++++++++++++++++++++++++++++++++|
elapsed: 16.1s total: 11.3 M (718.9 KiB/s)
unpacking linux/amd64 sha256:5916c280afae05baf0dc9a0cc82fa8e51477bdbfc72f60a5c14fd2b7735bcf07...
done: 9.498455ms
root@timo:~# ctr run -d docker.io/library/redis:alpine redis
ctr: failed to create shim task: OCI runtime create failed: unable to retrieve OCI runtime error (open /run/containerd/io.containerd.runtime.v2.task/default/redis/log.json: no such file or directory): exec: "runc": executable file not found in $PATH: unknown
root@timo:~#
直接报错了,报错很明显是缺少 runc,那就下载吧。
containerd在v1.6.4版本以后使用v1.1.2的runc和v1.1.1的cni。

下载链接:https://github.com/opencontainers/runc/releases/download/v1.1.2/runc.amd64
root@timo:~# install -m 755 runc.amd64 /usr/local/sbin/runc
root@timo:~# ls /usr/local/sbin/runc
/usr/local/sbin/runc
root@timo:~# runc -v
runc version 1.1.2
commit: v1.1.2-0-ga916309f
spec: 1.0.2-dev
go: go1.17.10
libseccomp: 2.5.3
root@timo:~#
顺便把CNI插件也安装上。
下载链接:https://github.com/containernetworking/plugins/releases/download/v1.1.1/cni-plugins-linux-amd64-v1.1.1.tgz
root@timo:~# mkdir -p /opt/cni/bin
root@timo:~# tar Cxzvf /opt/cni/bin cni-plugins-linux-amd64-v1.1.1.tgz
./
./macvlan
./static
./vlan
./portmap
./host-local
./vrf
./bridge
./tuning
./firewall
./host-device
./sbr
./loopback
./dhcp
./ptp
./ipvlan
./bandwidth
root@timo:~#
runc安装之后,前面的redis容器再重新启动试试。
root@timo:~# ctr container ls
CONTAINER IMAGE RUNTIME
redis docker.io/library/redis:alpine io.containerd.runc.v2
root@timo:~#
root@timo:~# ctr task start -d redis
root@timo:~# ctr task ls
TASK PID STATUS
redis 5602 RUNNING
root@timo:~#
containerd自带的 ctr 命令仅用于调试,建议下载 crictl。
下载链接:https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.24.2/crictl-v1.24.2-linux-amd64.tar.gz
root@timo:~# tar xzvf crictl-v1.24.2-linux-amd64.tar.gz
crictl
root@timo:~# install -m 755 crictl /usr/local/bin/crictl
root@timo:~# ls /usr/local/bin/crictl
/usr/local/bin/crictl
root@timo:~#
root@timo:~# crictl -v
crictl version v1.24.2
root@timo:~#
生成 crictl 的配置文件,用于连接到containerd。
建议做一下,可以将报错给屏蔽掉。
root@timo:~# crictl images
WARN[0000] image connect using default endpoints: [unix:///var/run/dockershim.sock unix:///run/containerd/containerd.sock unix:///run/crio/crio.sock unix:///var/run/cri-dockerd.sock]. As the default settings are now deprecated, you should set the endpoint instead.
ERRO[0000] unable to determine image API version: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial unix /var/run/dockershim.sock: connect: no such file or directory"
IMAGE TAG IMAGE ID SIZE
root@timo:~#
root@timo:~# cat > /etc/crictl.yaml <<EOF
> runtime-endpoint: unix:///run/containerd/containerd.sock
> image-endpoint: unix:///run/containerd/containerd.sock
> timeout: 10
> debug: false
> EOF
root@timo:~#
root@timo:~# cat /etc/crictl.yaml
runtime-endpoint: unix:///run/containerd/containerd.sock
image-endpoint: unix:///run/containerd/containerd.sock
timeout: 10
debug: false
root@timo:~#
root@timo:~# crictl images
IMAGE TAG IMAGE ID SIZE
root@timo:~# crictl pull busybox
Image is up to date for sha256:62aedd01bd8520c43d06b09f7a0f67ba9720bdc04631a8242c65ea995f3ecac8
root@timo:~# crictl images
IMAGE TAG IMAGE ID SIZE
docker.io/library/busybox latest 62aedd01bd852 778kB
root@timo:~#
温馨提示
containerd-<VERSION>-<OS>-<ARCH>.tar.gz 默认没提供runc和cni插件。
cri-containerd-(cni-)<VERSION>-<OS-<ARCH>.tar.gz 提供了runc和cni插件,但runc的依赖包libseccomp没有安装,有两种方式。
1、下载二进制的runc,替换掉原来的(推荐)。
2、Ubuntu的apt-get或CentOS的yum安装libseccomp。
我想为Heroku构建一个Rails3应用程序。他们使用Postgres作为他们的数据库,所以我通过MacPorts安装了postgres9.0。现在我需要一个postgresgem并且共识是出于性能原因你想要pggem。但是我对我得到的错误感到非常困惑当我尝试在rvm下通过geminstall安装pg时。我已经非常明确地指定了所有postgres目录的位置可以找到但仍然无法完成安装:$envARCHFLAGS='-archx86_64'geminstallpg--\--with-pg-config=/opt/local/var/db/postgresql90/defaultdb/po
我打算为ruby脚本创建一个安装程序,但我希望能够确保机器安装了RVM。有没有一种方法可以完全离线安装RVM并且不引人注目(通过不引人注目,就像创建一个可以做所有事情的脚本而不是要求用户向他们的bash_profile或bashrc添加一些东西)我不是要脚本本身,只是一个关于如何走这条路的快速指针(如果可能的话)。我们还研究了这个很有帮助的问题:RVM-isthereawayforsimpleofflineinstall?但有点误导,因为答案只向我们展示了如何离线在RVM中安装ruby。我们需要能够离线安装RVM本身,并查看脚本https://raw.github.com/wayn
我有一个奇怪的问题:我在rvm上安装了rubyonrails。一切正常,我可以创建项目。但是在我输入“railsnew”时重新启动后,我有“程序'rails'当前未安装。”。SystemUbuntu12.04ruby-v"1.9.3p194"gemlistactionmailer(3.2.5)actionpack(3.2.5)activemodel(3.2.5)activerecord(3.2.5)activeresource(3.2.5)activesupport(3.2.5)arel(3.0.2)builder(3.0.0)bundler(1.1.4)coffee-rails(
我刚刚为fedora安装了emacs。我想用emacs编写ruby。为ruby提供代码提示、代码完成类型功能所需的工具、扩展是什么? 最佳答案 ruby-mode已经包含在Emacs23之后的版本中。不过,它也可以通过ELPA获得。您可能感兴趣的其他一些事情是集成RVM、feature-mode(Cucumber)、rspec-mode、ruby-electric、inf-ruby、rinari(用于Rails)等。这是我当前用于Ruby开发的Emacs配置:https://github.com/citizen428/emacs
我正在尝试在我的centos服务器上安装therubyracer,但遇到了麻烦。$geminstalltherubyracerBuildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingtherubyracer:ERROR:Failedtobuildgemnativeextension./usr/local/rvm/rubies/ruby-1.9.3-p125/bin/rubyextconf.rbcheckingformain()in-lpthread...yescheckingforv8.h...no***e
我的最终目标是安装当前版本的RubyonRails。我在OSXMountainLion上运行。到目前为止,这是我的过程:已安装的RVM$\curl-Lhttps://get.rvm.io|bash-sstable检查已知(我假设已批准)安装$rvmlistknown我看到当前的稳定版本可用[ruby-]2.0.0[-p247]输入命令安装$rvminstall2.0.0-p247注意:我也试过这些安装命令$rvminstallruby-2.0.0-p247$rvminstallruby=2.0.0-p247我很快就无处可去了。结果:$rvminstall2.0.0-p247Search
我实际上是在尝试使用RVM在我的OSX10.7.5上更新ruby,并在输入以下命令后:rvminstallruby我得到了以下回复:Searchingforbinaryrubies,thismighttakesometime.Checkingrequirementsforosx.Installingrequirementsforosx.Updatingsystem.......Errorrunning'requirements_osx_brew_update_systemruby-2.0.0-p247',pleaseread/Users/username/.rvm/log/138121
由于fast-stemmer的问题,我很难安装我想要的任何rubygem。我把我得到的错误放在下面。Buildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingfast-stemmer:ERROR:Failedtobuildgemnativeextension./System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/rubyextconf.rbcreatingMakefilemake"DESTDIR="cleanmake"DESTDIR=
当我尝试安装Ruby时遇到此错误。我试过查看this和this但无济于事➜~brewinstallrubyWarning:YouareusingOSX10.12.Wedonotprovidesupportforthispre-releaseversion.Youmayencounterbuildfailuresorotherbreakages.Pleasecreatepull-requestsinsteadoffilingissues.==>Installingdependenciesforruby:readline,libyaml,makedepend==>Installingrub
当我执行>rvminstall1.9.2时一切顺利。然后我做>rvmuse1.9.2也很顺利。但是当涉及到ruby-v时..sam@sjones:~$rvminstall1.9.2/home/sam/.rvm/rubies/ruby-1.9.2-p136,thismaytakeawhiledependingonyourcpu(s)...ruby-1.9.2-p136-#fetchingruby-1.9.2-p136-#downloadingruby-1.9.2-p136,thismaytakeawhiledependingonyourconnection...%Total%Rece