Centos7.0操作Docker(二)

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/weixin_38959210/article/details/89306336

1.启动Docker

systemctl restart docker

2.查看Docker镜像

docker images

3.拉取容器

docker pull hello-world 

4.运行容器

 docker run hello-world

5.查看信息

Docker info  hello-world

6.查看正在运行的镜像

docker ps

      参数:-d: 后台运行容器,并返回容器ID

                  -i: 以交互模式运行容器,通常与 -t 同时使用;

                  -t: 为容器重新分配一个伪输入终端,通常与 -i 同时使用;

                  --name="nginx-lb": 为容器指定一个名称;

                 -p  网络端口

      docker run -p ip(可省略):本地端口:镜像端口 镜像名

    运行模拟:docker run -d -p  name

在Docker中运行应用程序

docker run  "hello-world"

 运行交互式的Docker

docker run -i -t docker.io/ubuntu:15.10 /bin/bash

猜你喜欢

转载自blog.csdn.net/weixin_38959210/article/details/89306336