国产片侵犯亲女视频播放_亚洲精品二区_在线免费国产视频_欧美精品一区二区三区在线_少妇久久久_在线观看av不卡

服務器之家:專注于服務器技術及軟件下載分享
分類導航

云服務器|WEB服務器|FTP服務器|郵件服務器|虛擬主機|服務器安全|DNS服務器|服務器知識|Nginx|IIS|Tomcat|

服務器之家 - 服務器技術 - 服務器知識 - 在CentOS 7上安裝Docker環境的方法與注意事項

在CentOS 7上安裝Docker環境的方法與注意事項

2020-09-25 20:46服務器之家 服務器知識

這篇文章主要介紹了在CentOS 7上安裝Docker環境的方法與注意事項,需要的朋友可以參考下

官網文檔:https://docs.docker.com/engine/installation/linux/centos/ ,本文大部分是照搬官方文檔寫的,如果你英文還不錯,那么就直接移步官方文檔吧,如果你英文實在是不行,那就勉強看一下本人這生澀的翻譯~

以下操作均在root用戶下完成

docker的安裝要求64位系統且內核版本大于3.10。所以如果是centos的話,必須安裝CentOS7.0或以上版本。
我們這里使用的是CentOS7.2 mininul。

uname -r
3.10.0-327.28.3.el7.x86_64

安裝docker前執行一下全系統的軟件版本升級:
yum -y update

1.配置yum軟件庫

為保證安裝的成功,首先使用yum update更新Yum包,表示我的好多yum包都需要更新,1500+的包,如果你像我一樣好久沒有更新過,那就耐心等候吧。
然后在yum軟件庫中新增docker的配置:

?
1
2
3
4
5
6
7
8
# tee /etc/yum.repos.d/docker.repo <<-'EOF'
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF

2.安裝Docker

有了yum軟件庫的配置之后,安裝也變得異常的簡單,只需要以下一句即可:

# yum install docker-engine

3.啟動Docker
一切就緒之后,使用start命令來啟動Docker守護進程:

# service docker start

4.輸出hello-world
程序員貌似跟hello-world有仇,有事兒沒事就打印人家一下,玩docker咱們當前也不例外,先來個hello-world吧,這里的基本原理是利用人家已經寫好的hello-world鏡像,下載到本地,然后把他運行起來~

使用以下命令:

# docker run hello-world

然后控制端會輸出類似于如下的信息,就證明我們的docker環境安裝成功了~

在CentOS 7上安裝Docker環境的方法與注意事項

在這里,我第一次失敗了~顯示:

?
1
2
3
Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/library/hello-world/manifests/latest: Get https://auth.docker.io/token?scope=repository%3Alibrary%2Fhello-world%3Apull&service=registry.docker.io: net/http: TLS handshake timeout.
See 'docker run --help'.

然后我又來了一次就好了,應該是墻的原因吧,看著是網絡訪問失敗了~

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c04b14da8d14: Pull complete
Digest: sha256:0256e8a36e2070f7bf2d0b0763dbabdd67798512411de4cdcf9431a1feb60fd9
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.
 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 Hub account:
 https://hub.docker.com
 
For more examples and ideas, visit:
 https://docs.docker.com/engine/userguide/

設置為自啟動:

chkconfig docker on

調整docker數據目錄:

把一個獨立的數據分區設置為docker數據目錄,需手工把docker原目錄的數據都移到新的存儲分區上去,然后以新的存儲分區掛載到/var/lib/docker目錄下。

service docker stop

拷數據及掛分區:

在CentOS 7上安裝Docker環境的方法與注意事項

service docker start

4、創建一個專用的docker group

docker是需要使用root權限運行的,但仍然可以通過創建一個專用的用戶組的方式,讓一個具備sudo權限的普通用戶管理docker服務。

 

復制代碼 代碼如下:

# groupadd docker
# usermod -aG docker bjxtb

 

退出當前會話,重新登錄后使用bjxtb直接管理docker:

$ docker run hello-world

運行一個 Docker 容器:

?
1
2
[root@localhost ~]# docker run -i -t centos /bin/bash
[root@dbf66395436d /]#

我們可以看到,CentOS 容器已經被啟動,并且我們得到了 bash 提示符。在 docker 命令中我們使用了 “-i 捕獲標準輸入輸出”和 “-t 分配一個終端或控制臺”選項。若要斷開與容器的連接,輸入 exit。

?
1
2
3
4
5
[root@cd05639b3f5c /]# cat /etc/RedHat-release
CentOSLinux release 7.0.1406(Core)
[root@cd05639b3f5c /]#exit
exit
[root@localhost ~]#

我們還可以搜索基于 Fedora 和 Ubuntu 操作系統的容器。

?
1
2
[root@localhost ~]# docker search ubuntu
[root@localhost ~]# docker search fedora

顯示當前正在運行容器的列表

在CentOS 7上安裝Docker環境的方法與注意事項

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 久久精品国产v日韩v亚洲 | 亚洲欧洲久久 | 中文字幕日产乱码六区小草 | 午夜视频一区 | 午夜桃色| 午夜在线小视频 | 国产成人久久精品麻豆二区 | 成人免费网视频 | 精品自拍视频 | 国产午夜精品久久 | 午夜精品电影 | 久久小视频 | 黄色的视频免费看 | 欧美自拍小视频 | 国产精品一区在线观看 | 午夜高清视频 | 久久国产精品久久久久久电车 | 色综合网在线 | 久草精品在线 | 交视频在线观看国产 | 天天干夜夜爽 | 精品黄色在线观看 | 久久综合一区二区 | 国产一区二区h | 乳首在线| 久久天堂电影 | 中文字幕国产一区 | 天堂中文网官网 | 国产精品久久久久久久久大全 | 亚洲专区欧美 | 2018自拍偷拍 | 黄频免费在线观看 | 日韩不卡一区二区三区 | 特黄特黄一级片 | 欧美国产日韩一区二区三区 | 久久人人av | 欧美激情一区二区三区在线视频 | 亚洲精品专区 | 黄视频在线免费看 | 精精国产xxxx视频在线观看 | 国产一区二区三区成人 |