1.先下載runc源碼:
https://github.com/opencontainers/runc/releases/tag/v1.0.3
2.我的是centos8
? 運(yùn)行以下代碼
yum install -y libseccomp-devel
3.安裝go環(huán)境
?wget https://studygolang.com/dl/golang/go1.16.linux-amd64.tar.gz
?tar -C /usr/local -xzf go1.16.linux-amd64.tar.gz
4.添加配置:
進(jìn)去到 vi /etc/profile
export GOROOT=/usr/local/go
export GOPATH=/home/gopath
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
5.檢測(cè)配置成功
go env
6.將下載好的runc解壓
? ?在這之前需要解決一個(gè)問(wèn)題:怎么把下載的文件放到虛擬機(jī)當(dāng)中????
? ? 我用的是winSCP:鏈接參考
文件傳輸工具WinSCP下載安裝教程_winscp安裝_12程序猿的博客-CSDN博客
tar ?-xzf runc-1.0.3.tar.gz
這段代碼是在 Linux 終端中執(zhí)行的命令,它使用了 `tar` 命令來(lái)解壓縮名為 "runc-1.0.3.tar.gz" 的文件。具體來(lái)說(shuō),這個(gè)命令做了以下幾件事情:
- `tar`:?jiǎn)?dòng) `tar` 命令。
如果你在其他文件下需要用到-C
- `-C /usr/local`:在解壓縮文件之前,切換到目錄 `/usr/local`,并將文件解壓縮到該目錄下。
- `-xzf`:使用 gzip 壓縮格式 (`z`) 解壓縮文件 (`x`),并輸出過(guò)程信息 (`f`)。
- `runc-1.0.3.tar.gz`:指定要解壓縮的文件名。
因此,在執(zhí)行這段代碼后,將會(huì)在 `/usr/local` 目錄下創(chuàng)建一個(gè)名為 `runc-1.0.3` 的子目錄,并在其中解壓縮 `runc-1.0.3.tar.gz` 文件中包含的所有文件和目錄。
?7.安裝runc
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
install -D -m0755 runc /usr/local/sbin/runc
install: cannot stat 'runc': No such file or directory
make: *** [Makefile:105: install] Error 1
出現(xiàn)這樣的錯(cuò)誤沒(méi)事的
7.1. 缺少 `git` 依賴(lài):根據(jù)錯(cuò)誤提示 "not a git repository" 可以得知,該軟件需要 `git` 程序來(lái)構(gòu)建。您可以使用以下命令安裝 `git`:
? ?yum install -y git
7.2.重新執(zhí)行make install
[root@localhost runc-1.0.3]# make install
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
install -D -m0755 runc /usr/local/sbin/runc
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
go build -trimpath "-mod=vendor" "-buildmode=pie" -tags "seccomp" -ldflags "-X main.gitCommit= -X main.version=1.0.3 " -o runc .
這個(gè)問(wèn)題可以忽略,它只是告訴您當(dāng)前目錄不在 Git 倉(cāng)庫(kù)中。在構(gòu)建 `runc` 時(shí)使用 Git 信息來(lái)生成版本號(hào)和提交哈希值的,如果當(dāng)前目錄不在 Git 倉(cāng)庫(kù)中,就無(wú)法獲取這些信息,但這不會(huì)影響 `runc` 的構(gòu)建。根據(jù)輸出信息顯示,`make` 命令已經(jīng)成功地構(gòu)建了 `runc` 程序,并將其輸出到當(dāng)前目錄。
8.重新運(yùn)行nginx容器文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-740688.html
文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-740688.html
到了這里,關(guān)于docker: Error response from daemon: failed to create shim task: OCI runtime create failed: unable to的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!