日日操夜夜添-日日操影院-日日草夜夜操-日日干干-精品一区二区三区波多野结衣-精品一区二区三区高清免费不卡

公告:魔扣目錄網(wǎng)為廣大站長提供免費(fèi)收錄網(wǎng)站服務(wù),提交前請(qǐng)做好本站友鏈:【 網(wǎng)站目錄:http://www.ylptlb.cn 】, 免友鏈快審服務(wù)(50元/站),

點(diǎn)擊這里在線咨詢客服
新站提交
  • 網(wǎng)站:51998
  • 待審:31
  • 小程序:12
  • 文章:1030137
  • 會(huì)員:747

目錄
  • 1 下載
  • 2 安裝
  • 3 替代docker
  • 4 替代docker-compose

1 下載

下載地址

url https://github.com/containerd/nerdctl/releases/

選擇安裝包

選擇這個(gè)完整版,可以連containerd一起安裝。

nerdctl替代docker及docker-compose的安裝使用

2 安裝

  • 解壓縮得到一下四個(gè)目錄
[root@liubei-02 nerdctl-full-1.0.0]# ll
drwxr-xr-x 2 root root      4096 10月 21 21:28 bin
drwxr-xr-x 3 root root        21 10月 21 21:27 lib
drwxr-xr-x 3 root root        17 10月 21 21:27 libexec
drwxr-xr-x 3 root root        17 10月 21 21:22 share
  • 拷貝二進(jìn)制文件
cp ./bin/* /usr/local/bin
  • 拷貝啟動(dòng)文件
cp -ra ./lib/systemd/system/* /etc/systemd/system/
  • 啟動(dòng)和開機(jī)啟動(dòng)
# systemctl enable buildkit containerd 
# systemctl restart buildkit containerd 
# systemctl status buildkit containerd
  • cni 插件
[root@liubei-02 nerdctl-full-1.2.1]# makedir /opt/cni/bin
[root@liubei-02 nerdctl-full-1.2.1]# cp -ra ./libexec/cni/* /opt/cni/bin/

3 替代docker

和docker命令幾乎相同,舉幾常用的命令做例子

  • 下載鏡像
[root@liubei-02 nerdctl-full-1.2.1]# nerdctl pull harbocto.boe.com.cn/crow/crow-qin
harbocto.boe.com.cn/crow/crow-qin:latest:                                         resolved       |++++++++++++++++++++++++++++++++++++++|
manifest-sha256:5891ae5e691914196af46e869a6cba45c6e53266b4110b85c5c37385cc3b6b84: done           |++++++++++++++++++++++++++++++++++++++|
config-sha256:04f135a90290c42b8cf9b52395c04753b4d9ed48ddae7c714a0eccdf8acd9682:   done           |++++++++++++++++++++++++++++++++++++++|
layer-sha256:b042f1415af977fb7da4d48f6668fad99add49542a1e01eb14f52a5e55338e54:    done           |++++++++++++++++++++++++++++++++++++++|
layer-sha256:31603596830fc7e56753139f9c2c6bd3759e48a850659506ebfb885d1cf3aef5:    done           |++++++++++++++++++++++++++++++++++++++|
layer-sha256:b0faaf7e563984a940329fd6098b28ecec4309b30990df5b9f7f1618f7f585bf:    done           |++++++++++++++++++++++++++++++++++++++|
layer-sha256:3c6f0abee76a3b1cde1a485efdc7d2f09d2023c61736f6d862b23d94a3bd0f6e:    done           |++++++++++++++++++++++++++++++++++++++|
elapsed: 0.9 s                                                                    total:  17.7 M (19.6 MiB/s)
  • 查看鏡像
[root@liubei-02 nerdctl-full-1.2.1]# nerdctl images
REPOSITORY                           TAG       IMAGE ID        CREATED           PLATFORM       SIZE         BLOB SIZE
harbocto.boe.com.cn/crow/crow-qin    latest    5891ae5e6919    34 seconds ago    linux/amd64    39.6 MiB     17.7 MiB
harbocto.boe.com.cn/public/mysql     5.7       9e02c7c9a87d    26 minutes ago    linux/amd64    428.5 MiB    143.5 MiB
  • 鏡像打tag
[root@liubei-02 crow-qin]# nerdctl tag harbocto.boe.com.cn/crow/crow-qin harbocto.boe.com.cn/crow/crow-qin:0327
[root@liubei-02 crow-qin]# nerdctl images
REPOSITORY                           TAG       IMAGE ID        CREATED          PLATFORM       SIZE         BLOB SIZE
harbocto.boe.com.cn/crow/crow-qin    0327      5891ae5e6919    4 seconds ago    linux/amd64    39.6 MiB     17.7 MiB
harbocto.boe.com.cn/crow/crow-qin    latest    5891ae5e6919    4 hours ago      linux/amd64    39.6 MiB     17.7 MiB
harbocto.boe.com.cn/public/mysql     5.7       9e02c7c9a87d    4 hours ago      linux/amd64    428.5 MiB    143.5 MiB
  • 刪除鏡像
[root@liubei-02 crow-qin]# nerdctl rmi harbocto.boe.com.cn/crow/crow-qin:0327
Untagged: harbocto.boe.com.cn/crow/crow-qin:0327@sha256:5891ae5e691914196af46e869a6cba45c6e53266b4110b85c5c37385cc3b6b84
Deleted: sha256:89ae5c4ee501a09c879f5b58474003539ab3bb978a553af2a4a6a7de248b5740
Deleted: sha256:4e8c762c91062b88c9c07813b2cf0795d81401dd0fb0c19bed291901dd4f1cbd
Deleted: sha256:248001ffdc3a1a316501cd5b435bf6346fa6ddd88acecd90cff9cc08f5e2b3ed
Deleted: sha256:bbd2fde7f96c461ee59290dc20dc461036e1288f6e7e88c805aa2d1619c1c0c6
[root@liubei-02 crow-qin]# nerdctl images
REPOSITORY                           TAG       IMAGE ID        CREATED        PLATFORM       SIZE         BLOB SIZE
harbocto.boe.com.cn/crow/crow-qin    latest    5891ae5e6919    4 hours ago    linux/amd64    39.6 MiB     17.7 MiB
harbocto.boe.com.cn/public/mysql     5.7       9e02c7c9a87d    4 hours ago    linux/amd64    428.5 MiB    143.5 MiB
  • 啟動(dòng)容器
[root@liubei-02 ~]# nerdctl run -d -p 1840:1840 --name crow-qin harbocto.boe.com.cn/crow/crow-qin
b61ea892800e970b9a21279943342309b5b9496ff82a8fe8e50c9216b041ca94
  • 查看容器
CONTAINER ID    IMAGE                                       COMMAND        CREATED               STATUS    PORTS                     NAMES
b61ea892800e    harbocto.boe.com.cn/crow/crow-qin:latest    "/crow-qin"    About a minute ago    Up        0.0.0.0:1840->1840/tcp    crow-qin
  • 停止容器
[root@liubei-02 ~]# nerdctl stop crow-qin
crow-qin
[root@liubei-02 ~]# nerdctl ps -a
CONTAINER ID    IMAGE                                       COMMAND        CREATED          STATUS                       PORTS                     NAMES
b61ea892800e    harbocto.boe.com.cn/crow/crow-qin:latest    "/crow-qin"    2 minutes ago    Exited (2) 15 seconds ago    0.0.0.0:1840->1840/tcp    crow-qin
  • 刪除容器
[root@liubei-02 ~]# nerdctl rm crow-qin
crow-qin
[root@liubei-02 ~]# nerdctl ps -a
CONTAINER ID    IMAGE    COMMAND    CREATED    STATUS    PORTS    NAMES

4 替代docker-compose

  • docker-compose.yml文件如下
version: "3"
services:
  crow_qin:
    image: harbocto.boe.com.cn/crow/crow-qin
    ports:
      - 1840:1840
    restart: always
  • 啟動(dòng)容器
[root@liubei-02 crow-qin]# nerdctl compose up -d
INFO[0000] Creating network crow-qin_default
INFO[0000] Ensuring image harbocto.boe.com.cn/crow/crow-qin
INFO[0000] Creating container crow-qin_crow_qin_1
  • 查看結(jié)果
[root@liubei-02 crow-qin]# nerdctl ps
CONTAINER ID    IMAGE                                       COMMAND        CREATED           STATUS    PORTS                     NAMES
a0ebebf7bb9d    harbocto.boe.com.cn/crow/crow-qin:latest    "/crow-qin"    12 seconds ago    Up        0.0.0.0:1840->1840/tcp    crow-qin_crow_qin_1
  • 查看日志
[root@liubei-02 crow-qin]# nerdctl compose logs -f
crow_qin_1 |&{MysqlConf:{MysqlIp:10.10.239.136 MysqlPort:3306 DbName:crow MysqlUser:root MysqlPassword:1234} RedisConf:{RidesIp:10.10.239.136 RidesPort:6379 RidesDbNum:2 RidesPassword:""}}
crow_qin_1 |2023-03-27 13:40:48.649648 INFO config/connect_mysql.go:48 數(shù)據(jù)庫鏈接成功
crow_qin_1 |2023-03-27 13:40:48.649728 INFO config/connect_redis.go:19 Redis<10.10.239.136:6379 db:2>
crow_qin_1 |2023-03-27 13:40:48.650863 INFO cache/example.go:51 OK
crow_qin_1 |2023-03-27 13:40:48.650873 INFO cache/example.go:53 redis 鏈接成功
crow_qin_1 |OK
crow_qin_1 |[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.
crow_qin_1 |
crow_qin_1 |[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
crow_qin_1 | - using env:       export GIN_MODE=release
crow_qin_1 | - using code:      gin.SetMode(gin.ReleaseMode)
crow_qin_1 |
crow_qin_1 |[GIN-debug] GET    /swagger/*any             --> github.com/swaggo/gin-swagger.CustomWrapHandler.func1 (3 handlers)
crow_qin_1 |[GIN-debug] GET    /api/v1/ping              --> crow-qin/src/router.Ping (3 handlers)
crow_qin_1 |[GIN-debug] GET    /api/v1/version           --> crow-qin/src/router.Version (3 handlers)
crow_qin_1 |[GIN-debug] GET    /api/v1/liubei            --> crow-qin/src/router.LiuBei (3 handlers)
crow_qin_1 |[GIN-debug] POST   /api/v1/login             --> crow-qin/src/router.Login (3 handlers)
crow_qin_1 |[GIN-debug] POST   /api/v1/login/refresh     --> crow-qin/src/router.Refresh (3 handlers)
crow_qin_1 |[GIN-debug] POST   /api/v1/admin/user        --> crow-qin/src/router.CreateUser (4 handlers)
crow_qin_1 |[GIN-debug] PUT    /api/v1/admin/user-password --> crow-qin/src/router.ResetUserPassword (4 handlers)
crow_qin_1 |[GIN-debug] GET    /api/v1/admin/users       --> crow-qin/src/router.GetUsers (4 handlers)
crow_qin_1 |[GIN-debug] GET    /api/v1/admin/users/:uuid --> crow-qin/src/router.GetUser (4 handlers)
crow_qin_1 |[GIN-debug] DELETE /api/v1/admin/users/:uuid --> crow-qin/src/router.DeleteUser (4 handlers)
crow_qin_1 |[GIN-debug] PUT    /api/v1/admin/users       --> crow-qin/src/router.UpdateUsersInfo (4 handlers)
crow_qin_1 |[GIN-debug] PUT    /api/v1/user/info         --> crow-qin/src/router.UpdateUserInfo (4 handlers)
crow_qin_1 |[GIN-debug] PUT    /api/v1/user/password     --> crow-qin/src/router.UpdateUserPassword (4 handlers)
crow_qin_1 |[GIN-debug] GET    /api/v1/user/info         --> crow-qin/src/router.GetUserInfo (4 handlers)
crow_qin_1 |[GIN-debug] GET    /                         --> crow-qin/src/router.ServerRouter.func1 (3 handlers)
crow_qin_1 |[GIN-debug] GET    /js/*filepath             --> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (3 handlers)
crow_qin_1 |[GIN-debug] HEAD   /js/*filepath             --> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (3 handlers)
crow_qin_1 |[GIN-debug] [WARNING] You trusted all proxies, this is NOT safe. We recommend you to set a value.
crow_qin_1 |Please check https://pkg.go.dev/github.com/gin-gonic/gin#readme-don-t-trust-all-proxies for details.
crow_qin_1 |[GIN-debug] Listening and serving HTTP on :1840
  • 關(guān)閉容器
[root@liubei-02 crow-qin]# nerdctl compose down
INFO[0000] Removing container crow-qin_crow_qin_1
INFO[0000] Removing network crow-qin_default

以上就是nerdctl替代docker及docker-compose的安裝使用的詳細(xì)內(nèi)容,更多關(guān)于nerdctl替代docker的資料請(qǐng)關(guān)注其它相關(guān)文章!

分享到:
標(biāo)簽:compose Docker nerdctl 安裝 服務(wù)器
用戶無頭像

網(wǎng)友整理

注冊(cè)時(shí)間:

網(wǎng)站:5 個(gè)   小程序:0 個(gè)  文章:12 篇

  • 51998

    網(wǎng)站

  • 12

    小程序

  • 1030137

    文章

  • 747

    會(huì)員

趕快注冊(cè)賬號(hào),推廣您的網(wǎng)站吧!
最新入駐小程序

數(shù)獨(dú)大挑戰(zhàn)2018-06-03

數(shù)獨(dú)一種數(shù)學(xué)游戲,玩家需要根據(jù)9

答題星2018-06-03

您可以通過答題星輕松地創(chuàng)建試卷

全階人生考試2018-06-03

各種考試題,題庫,初中,高中,大學(xué)四六

運(yùn)動(dòng)步數(shù)有氧達(dá)人2018-06-03

記錄運(yùn)動(dòng)步數(shù),積累氧氣值。還可偷

每日養(yǎng)生app2018-06-03

每日養(yǎng)生,天天健康

體育訓(xùn)練成績?cè)u(píng)定2018-06-03

通用課目體育訓(xùn)練成績?cè)u(píng)定