第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

Docker

標(biāo)簽:
Docker

移除旧的版本

sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-selinux \
                  docker-engine-selinux \
                  docker-engine

安装一些必要的系统工具

yum install -y yum-utils device-mapper-persistent-data lvm2

添加软件源信息

yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

更新 yum 缓存

yum makecache fast

安装 Docker-ce

yum -y install docker-ce

启动Docker后台服务

systemctl start docker

测试运行 hello-world

docker run hello-world

运行结果

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Pull complete 
Digest: sha256:0e11c388b664df8a27a901dce21eb89f11d8292f7fca1b3e3c4321bf7897bffe
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the “hello-world” image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

Docker运行nginx

  1. 拉取镜像

docker pull hub.c.163.com/library/nginx:latest
  1. 以后台运行nginx,并指定端口映射。- -name指定容器名称,如果不指定,默认会随机生成一个名称,-d代表后台运行,8080是指主机端口,80为容器端口

docker run --name nginx-test -d -p 8080:80 hub.c.163.com/library/nginx
  1. 使用docker ps命令查看运行的容器

CONTAINER IDIMAGEPORTSNAMES
4f1523ef4d16hub.c.163.com/library/nginx0.0.0.0:8080->80/tcpnginx-test
  1. 浏览器输入ip:8080即可访问到nginx页面

常用命令

  1. 拉取镜像,TAG是版本号的意思

docker pull [OPTIONS] NAME[:TAG]
  1. 查看本机有哪些镜像,[REPOSITORY [:TAG]]指定镜像名称和TAG

docker images [OPTIONS] [REPOSITORY [:TAG]]
  1. 删除镜像

docker rmi IMAGEID
  1. 强制删除镜像

docker rmi -f IMAGEID
  1. 运行docker,COMMAND是指要执行的命令,ARG…是指命令依赖的参数

docker run [OPTIONS] IMAGE[:TAG] [COMMAND] [ARG…]
  1. 查看机器上运行的容器

docker ps
  1. 查看机器上运行过的容器

docker ps -a
  1. 进入运行的容器

docker exec -it CONTAINERID /bin/bash
  1. 停止容器

docker stop CONTAINERID
  1. 启动容器

docker start CONTAINERID
  1. 停用全部运行中的容器

docker stop KaTeX parse error: Expected 'EOF', got '&' at position 8: (docker&̲nbsp;ps -q…(docker ps -aq)
  1. 一条命令实现停用并删除容器

docker stop KaTeX parse error: Expected 'EOF', got '&' at position 8: (docker&̲nbsp;ps -q…(docker ps -aq)


點(diǎn)擊查看更多內(nèi)容
TA 點(diǎn)贊

若覺得本文不錯(cuò),就分享一下吧!

評(píng)論

作者其他優(yōu)質(zhì)文章

正在加載中
  • 推薦
  • 評(píng)論
  • 收藏
  • 共同學(xué)習(xí),寫下你的評(píng)論
感謝您的支持,我會(huì)繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會(huì)直接到老師賬戶
支付方式
打開微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊(cè)有機(jī)會(huì)得

100積分直接送

付費(fèi)專欄免費(fèi)學(xué)

大額優(yōu)惠券免費(fèi)領(lǐng)

立即參與 放棄機(jī)會(huì)
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)

舉報(bào)

0/150
提交
取消