首页 > 其他分享 >nerdctl安装

nerdctl安装

时间:2022-10-11 15:34:06浏览次数:39  
标签:string -- containerd nerdctl default 安装 containers

nerdctl介绍

  • nerdctl 是 与 Docker 兼容的CLI for Containerd,其支持Compose
  • nerdctl 和 docker命令行语法很相似,学习比较容易
  • nerdctl 官方发布包包含两个安装版本:
    • Minimal: 仅包含 nerdctl 二进制文件以及 rootless 模式下的辅助安装脚本
    • Full: 看名字就能知道是个全量包,其包含了 Containerd、CNI、runc、BuildKit 等完整组件

nerdctl 安装

下载地址: https://github.com/containerd/nerdctl/releases

~# export version=0.23.0
~# wget https://github.com/containerd/nerdctl/releases/download/v${version}/nerdctl-full-${version}-linux-amd64.tar.gz
~# tar Cxzvvf /usr/local nerdctl-full-${version}-linux-amd64.tar.gz

nerdctl用法

~# nerdctl -h
nerdctl is a command line interface for containerd

Config file ($NERDCTL_TOML): /etc/nerdctl/nerdctl.toml

Usage: nerdctl [flags]

Management commands:
  apparmor   Manage AppArmor profiles
  builder    Manage builds
  container  Manage containers
  image      Manage images
  ipfs       Distributing images on IPFS
  namespace  Manage containerd namespaces
  network    Manage networks
  system     Manage containerd
  volume     Manage volumes

Commands:
  build       Build an image from a Dockerfile. Needs buildkitd to be running.
  commit      Create a new image from a container's changes
  completion  Generate the autocompletion script for the specified shell
  compose     Compose
  cp          Copy files/folders between a running container and the local filesystem.
  create      Create a new container. Optionally specify "ipfs://" or "ipns://" scheme to pull image from IPFS.
  events      Get real time events from the server
  exec        Run a command in a running container
  help        Help about any command
  history     Show the history of an image
  images      List images
  info        Display system-wide information
  inspect     Return low-level information on objects.
  internal    DO NOT EXECUTE MANUALLY
  kill        Kill one or more running containers
  load        Load an image from a tar archive or STDIN
  login       Log in to a Docker registry
  logout      Log out from a Docker registry
  logs        Fetch the logs of a container. Currently, only containers created with `nerdctl run -d` are supported.
  pause       Pause all processes within one or more containers
  port        List port mappings or a specific mapping for the container
  ps          List containers
  pull        Pull an image from a registry. Optionally specify "ipfs://" or "ipns://" scheme to pull image from IPFS.
  push        Push an image or a repository to a registry. Optionally specify "ipfs://" or "ipns://" scheme to push image to IPFS.
  rename      rename a container
  restart     Restart one or more running containers
  rm          Remove one or more containers
  rmi         Remove one or more images
  run         Run a command in a new container. Optionally specify "ipfs://" or "ipns://" scheme to pull image from IPFS.
  save        Save one or more images to a tar archive (streamed to STDOUT by default)
  start       Start one or more running containers
  stats       Display a live stream of container(s) resource usage statistics.
  stop        Stop one or more running containers
  tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
  top         Display the running processes of a container
  unpause     Unpause all processes within one or more containers
  update      Update one or more running containers
  version     Show the nerdctl version information
  wait        Block until one or more containers stop, then print their exit codes.

Flags:
  -H, --H string                 Alias of --address (default "/run/containerd/containerd.sock")
  -a, --a string                 Alias of --address (default "/run/containerd/containerd.sock")
      --address string           containerd address, optionally with "unix://" prefix [$CONTAINERD_ADDRESS] (default "/run/containerd/containerd.sock")
      --cgroup-manager string    Cgroup manager to use ("cgroupfs"|"systemd") (default "cgroupfs")
      --cni-netconfpath string   cni config directory [$NETCONFPATH] (default "/etc/cni/net.d")
      --cni-path string          cni plugins binary directory [$CNI_PATH] (default "/opt/cni/bin")
      --data-root string         Root directory of persistent nerdctl state (managed by nerdctl, not by containerd) (default "/var/lib/nerdctl")
      --debug                    debug mode
      --debug-full               debug mode (with full output)
      --experimental             Control experimental: https://github.com/containerd/nerdctl/blob/master/docs/experimental.md [$NERDCTL_EXPERIMENTAL] (default true)
  -h, --help                     help for nerdctl
      --host string              Alias of --address (default "/run/containerd/containerd.sock")
      --hosts-dir strings        A directory that contains <HOST:PORT>/hosts.toml (containerd style) or <HOST:PORT>/{ca.cert, cert.pem, key.pem} (docker style) (default [/etc/containerd/certs.d,/etc/docker/certs.d])
      --insecure-registry        skips verifying HTTPS certs, and allows falling back to plain HTTP
  -n, --n string                 Alias of --namespace (default "default")
      --namespace string         containerd namespace, such as "moby" for Docker, "k8s.io" for Kubernetes [$CONTAINERD_NAMESPACE] (default "default")
      --snapshotter string       containerd snapshotter [$CONTAINERD_SNAPSHOTTER] (default "overlayfs")
      --storage-driver string    Alias of --snapshotter (default "overlayfs")
  -v, --version                  version for nerdctl

Run 'nerdctl COMMAND --help' for more information on a command.

nerdctl使用样例

# nerdctl run -d --name nginx -p 80:80 nginx:alpine

To run a container with the default bridge CNI network (10.4.0.0/24):
# nerdctl run -it --rm alpine

To build an image using BuildKit:
# nerdctl build -t foo /some-dockerfile-directory
# nerdctl run -it --rm foo

To build and send output to a local directory using BuildKit:
# nerdctl build -o type=local,dest=. /some-dockerfile-directory

To run containers from docker-compose.yaml
# nerdctl compose -f ./examples/compose-wordpress/docker-compose.yaml up

nerdctl添加组件

# containerd-rootless-setuptool.sh install-buildkit

参考文档

https://github.com/containerd/nerdctl

 

标签:string,--,containerd,nerdctl,default,安装,containers
From: https://www.cnblogs.com/wangguishe/p/16779282.html

相关文章

  • WSL 2 的安装过程(以及介绍)
    微信公众号:运维开发故事,作者:冬子先生1什么是WSL2WSL全称为WindowsSubsystemforLinux,官网译为:适用于Linux的Windows子系统(WSL)官方文档直达:适用于Linux的Wind......
  • crictl安装
    crictl介绍crictl是CRI兼容的容器运行时命令行接口,和containerd无关,由Kubernetes提供,可以使用它来检查和调试k8s节点上的容器运行时和应用程序。安装crictl下载地......
  • android开发apk安装失败对应的错误码以及原因
    android开发apk安装失败对应的错误码以及原因代码在PackageManager.java系统类里中文意思可参考:https://www.cnblogs.com/cwfsoft/p/11776094.html/***@hide 未知*......
  • eclipse 安装sts插件
    1、在线安装http://download.springsource.com/release/TOOLS/update/e4.16/a、查看eclise版本,把对应的版本修改下b、点击help-installnewsoftware,输入name和url,勾选......
  • EXSI生产服务器安装
    【厂商链接】联想:https://vmware.lenovo.com/content/custom_iso/【参考文档】【3】安装VMwarevSphereESXI做一次运维之VMwareESXI虚拟化联想服务器SR550(ThinkSys......
  • Windows / Mac 安装Typora(1.2.4版)
    TyporaTypora是一款支持实时预览的Markdown文本编辑器。附件下载:Typora附件Windows版本1.解压Typora_1.3.8_windows.rar文件 2.双击Setup.exe直接选择推荐的......
  • Nmap安装
     Nmap(NetworkMapper,网络映射器)是一款开放源代码的网络探测和安全审核工具。它被设计用来快速扫描大型网络,包括主机探测与发现、开放的端口情况、操作系统与应用服务指纹......
  • 永久配置 “国内镜像源”,安装东西,像做火箭一样,蹭就上去啦!妈妈再也不担心我学不到东西
    问题来源今天在使用pipinstallxlutils安装xlutils包的时候,一直出现了该错误ReadTimeoutError:HTTPSConnectionPool(host=‘files.pythonhosted.org’,port=443):Readt......
  • Android studio安装教程
    Androidstudio安装教程傻瓜式教程如果想要彻底重装Androidstudio可以删除目录C:\Users\用户名中的以下几个文件夹。.android.gradle.Androidstudio(Androidstud......
  • containerd 安装
    仓库安装root@wgs:~#aptupdateroot@wgs:~#apt-yinstallcontainerdroot@wgs:~#systemctlstatuscontainerd二进制安装安装containerd下载containerd下载地址......