Docker的常用命令(1)

简介:
[root@jiaxin-ceshi logs]# docker help
Usage:    docker [OPTIONS] COMMAND

A self-sufficient runtime for containers

Options:
      --config string      Location of client config files (default "/root/.docker")
  -D, --debug              Enable debug mode
  -H, --host list          Daemon socket(s) to connect to
  -l, --log-level string   Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info")
      --tls                Use TLS; implied by --tlsverify
      --tlscacert string   Trust certs signed only by this CA (default "/root/.docker/ca.pem")
      --tlscert string     Path to TLS certificate file (default "/root/.docker/cert.pem")
      --tlskey string      Path to TLS key file (default "/root/.docker/key.pem")
      --tlsverify          Use TLS and verify the remote
  -v, --version            Print version information and quit

Management Commands:
  config      Manage Docker configs
  container   Manage containers
  image       Manage images
  network     Manage networks
  node        Manage Swarm nodes
  plugin      Manage plugins
  secret      Manage Docker secrets
  service     Manage services
  stack       Manage Docker stacks
  swarm       Manage Swarm
  system      Manage Docker
  trust       Manage trust on Docker images
  volume      Manage volumes

Commands:
  attach      Attach local standard input, output, and error streams to a running container
  build       Build an image from a Dockerfile
  commit      Create a new image from a container's changes
  cp          Copy files/folders between a container and the local filesystem
  create      Create a new container
  diff        Inspect changes to files or directories on a container's filesystem
  events      Get real time events from the server
  exec        Run a command in a running container
  export      Export a container's filesystem as a tar archive
  history     Show the history of an image
  images      List images
  import      Import the contents from a tarball to create a filesystem image
  info        Display system-wide information
  inspect     Return low-level information on Docker objects
  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
  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 or a repository from a registry
  push        Push an image or a repository to a registry
  rename      Rename a container
  restart     Restart one or more containers
  rm          Remove one or more containers
  rmi         Remove one or more images
  run         Run a command in a new container
  save        Save one or more images to a tar archive (streamed to STDOUT by default)
  search      Search the Docker Hub for images
  start       Start one or more stopped 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 configuration of one or more containers
  version     Show the Docker version information
  wait        Block until one or more containers stop, then print their exit codes

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

-V 版本打印版本信息和退出

查看当前运行的容器


[root@jiaxin-ceshi logs]# docker ps

获取镜像
docker pull --help

docker pull 镜像名称

查看镜像信息

[root@jiaxin-ceshi logs]# docker images

查找景象

[root@jiaxin-ceshi logs]# docker search nginx

下载镜像

[root@jiaxin-ceshi logs]# docker pull nginx
相关文章
|
2月前
|
存储 Java Linux
【Docker】(2)还在浏览网页寻找Docker命令?本文全面列举与使用Docker里的各个命令!想要什么命令直接从本文拿!
docker有着比VM更少的抽象层 由于Docker不需要Hypervisor实现硬件资源虚拟化,运行在Docker容器上的程序直接使用的都是实际物理机的硬件资源 因此在CPU、内存利用率上Docker将会在效率上有明显优势 docker利用的时宿主机的内核,而不需要加载操作系统OS内核 当新建一个容器时,Docker不需要和虚拟机一样重新加载一个操作系统内核 进而避免引寻、加载操作系统内核返回等比较费时费资源的过程,当新建一个虚拟机时,虚拟机软件需要加载OS,返回新建过程时分钟级别的。 而Docker由于直接利用宿主机的操作系统,则省略了返回过程,因此新建一个Docker容器只需
384 124
|
5月前
|
安全 Unix Linux
Docker中授权普通用户使用docker命令以及解决无权限访问/var/run/docker.sock错误。
通过上述步骤,可以有效解决普通用户无法使用Docker命令的问题,同时处理 `/var/run/docker.sock`权限错误。这样的设置不仅方便用户使用Docker提供的各项服务,同时还能保护系统的安全性。在进行此类配置更改时,请确保理解每一步骤的作用及潜在的安全风险,尤其是在修改文件权限时。在实际的操作中,始终应该努力保持系统的最低必要权限,避免过度放宽权限,这是保障系统安全的一个重要方针。
1646 75
|
6月前
|
Docker 容器
Docker run命令-p参数详解
本文介绍Docker端口映射的基础用法。通过`docker run -p <宿主机端口>:<容器端口>`实现端口映射,例如`-p 5000:80`将宿主机5000端口映射到容器80端口,外部访问宿主机5000端口时流量会转发至容器内部的80端口。示例命令中,`-d`用于后台运行,`--restart=always`确保容器自动重启,`--name`指定容器名称。部署完成后可通过`http://服务器IP地址:5000`验证服务是否正常运行。
|
5月前
|
Docker 容器
熟悉Docker容器管理命令:start、stop与restart详细使用指南
掌握这些Docker容器管理命令对于维护应用程序的正常运行至关重要。在实际操作中,应注意容器配置、关联资源以及日志等信息,确保各项操作都能够顺畅并且安全地执行。
662 0
|
7月前
|
网络协议 Ubuntu Docker
Docker Compose--命令说明
Docker Compose--命令说明
1142 30
|
7月前
|
Ubuntu Linux 开发者
常用的Docker命令:docker_cmd_sheet
以上就是一些常用的Docker命令,希望能帮助你更好地驾驭这个强大的工具。记住,Docker就像是一个魔法咒语,只有真正理解和熟练使用,才能发挥出它的最大魔力。
170 22
|
7月前
|
Shell 应用服务中间件 nginx
docker 镜像的部分常用命令
docker镜像常用命令
242 16
|
7月前
|
关系型数据库 MySQL Docker
|
7月前
|
关系型数据库 MySQL 数据库
Docker 安装常用软件相关命令
本文介绍了在CentOS 7.9系统上安装Docker的详细步骤,包括添加阿里云镜像源、安装Docker及相关组件、启动服务以及配置镜像加速。同时,还展示了如何通过Docker安装MySQL 5.7版本数据库,涵盖拉取镜像、创建数据目录、运行容器及配置挂载点等操作,并提供验证安装成功的命令和截图。适合需要部署Docker与MySQL环境的用户参考。
401 6
|
NoSQL 关系型数据库 MySQL
《docker高级篇(大厂进阶):4.Docker网络》包括:是什么、常用基本命令、能干嘛、网络模式、docker平台架构图解
《docker高级篇(大厂进阶):4.Docker网络》包括:是什么、常用基本命令、能干嘛、网络模式、docker平台架构图解
429 56
《docker高级篇(大厂进阶):4.Docker网络》包括:是什么、常用基本命令、能干嘛、网络模式、docker平台架构图解

热门文章

最新文章