激情久久久_欧美视频区_成人av免费_不卡视频一二三区_欧美精品在欧美一区二区少妇_欧美一区二区三区的

服務(wù)器之家:專注于服務(wù)器技術(shù)及軟件下載分享
分類導(dǎo)航

Linux|Centos|Ubuntu|系統(tǒng)進(jìn)程|Fedora|注冊(cè)表|Bios|Solaris|Windows7|Windows10|Windows11|windows server|

服務(wù)器之家 - 服務(wù)器系統(tǒng) - Centos - Centos下安裝docker教程

Centos下安裝docker教程

2020-09-22 16:38Centos教程網(wǎng) Centos

本文給大家介紹的是在centos下安裝docker的詳細(xì)教程,分為yum安裝和腳本安裝2種方式,有需要的小伙伴可以參考下。

通過yum安裝

需要root或者能sudo的權(quán)限

yum包更新到最新

 
?
1
 
$ sudo yum update

添加Docker yum源

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

安裝Docker包

 
?
1
 
$ sudo yum install docker-engine

啟動(dòng)Docker守護(hù)進(jìn)程

 
?
1
 
$ sudo service docker start

通過測(cè)試鏡像運(yùn)行一個(gè)容器來驗(yàn)證Docker是否安裝正確

 
?
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
26
27
28
$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
  latest: Pulling from hello-world
  a8219747be10: Pull complete
  91c95931e552: Already exists
  hello-world:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
  Digest: sha256:aa03e5d0d5553b4c3473e89c8619cf79df368babd1.7.1cf5daeb82aab55838d
  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.
      (Assuming it was not already locally available.)
   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
 
 
  For more examples and ideas, visit:
   http://docs.docker.com/userguide/

通過腳本安裝

需要root或者能sudo的權(quán)限

yum包更新到最新

 
?
1
 
$ sudo yum update

運(yùn)行Docker安裝腳本

 
?
1
 
$ curl -sSL https://get.docker.com/ | sh

這個(gè)腳本會(huì)添加docker.repo倉(cāng)庫(kù)并且安裝Docker

啟動(dòng)Docker守護(hù)進(jìn)程

 
?
1
 
$ sudo service docker start

通過測(cè)試鏡像運(yùn)行一個(gè)容器來驗(yàn)證Docker是否安裝正確

 
?
1
 
$ sudo docker run hello-world

創(chuàng)建一個(gè)Docker用戶組

docker守護(hù)進(jìn)程綁定在Unix socket 而不是 TCP 端口。默認(rèn)情況下Unix socket屬于root用戶和具有sudo權(quán)限用戶的使用范疇。出于這個(gè)原因,docker守護(hù)進(jìn)程需要一直在root用戶下面運(yùn)行。

To avoid having to use sudo when you use the docker command, create a Unix group called docker and add users to it. When the docker daemon starts, it makes the ownership of the Unix socket read/writable by the docker group.

為了避免運(yùn)行docker命令的時(shí)候需要使用sudo命令,創(chuàng)建一個(gè)叫docker的Unix用戶組并將需要運(yùn)行docker的用戶添加進(jìn)去。當(dāng)開始運(yùn)行docker守護(hù)進(jìn)程,會(huì)令docker用戶組的成員擁有Unix socket的讀寫權(quán)限。

創(chuàng)建docker用戶組并添加用戶:

1.需要root或者能sudo的權(quán)限
2.創(chuàng)建docker用戶組并添加用戶

 
?
1
 
sudo usermod -aG docker your_username

3.退出并且登錄到y(tǒng)our_username,如果在your_username下也建議退出再重新登錄一次,這確保您的用戶正在運(yùn)行正確的權(quán)限。
4.驗(yàn)證運(yùn)行docker已不再需要sudo命令

 
?
1
 
$ docker run hello-world

開機(jī)運(yùn)行docker

 
?
1
 
$ sudo chkconfig docker on

 

延伸 · 閱讀

精彩推薦
  • Centoscentos不小心刪除/root目錄該如何解決?

    centos不小心刪除/root目錄該如何解決?

    一些朋友最近在問小編centos不小心刪除/root目錄該如何解決?今天小編就為大家分享centos不小心刪除/root目錄解決辦法;希望對(duì)大家會(huì)有幫助,有需要的朋友...

    腳本之家8022019-05-29
  • Centoscentos 安裝與操作方法

    centos 安裝與操作方法

    這篇文章主要介紹了centos 安裝與操作方法,需要的朋友可以參考下...

    centos之家5272019-07-11
  • CentosCentos 7開啟網(wǎng)卡自動(dòng)獲取IP的詳細(xì)方法

    Centos 7開啟網(wǎng)卡自動(dòng)獲取IP的詳細(xì)方法

    本篇文章主要介紹了Centos 7開啟網(wǎng)卡自動(dòng)獲取IP的詳細(xì)方法,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧...

    凌鋒8972021-12-29
  • CentosCentOS6.5下Redis安裝與配置詳細(xì)步驟

    CentOS6.5下Redis安裝與配置詳細(xì)步驟

    本篇文章主要介紹了CentOS6.5下Redis安裝與配置詳細(xì)步驟,詳細(xì)介紹redis單機(jī)單實(shí)例安裝與配置,服務(wù)及開機(jī)自啟動(dòng)。有興趣的可以了解一下。...

    飛流11452021-12-24
  • CentosCentos7運(yùn)用/dev/shm進(jìn)行網(wǎng)站優(yōu)化

    Centos7運(yùn)用/dev/shm進(jìn)行網(wǎng)站優(yōu)化

    這篇文章主要介紹了LINUX中Centos7運(yùn)用/dev/shm進(jìn)行網(wǎng)站優(yōu)化相關(guān)知識(shí)點(diǎn),對(duì)此有興趣的朋友參考學(xué)習(xí)下。...

    彬菌9912022-03-02
  • CentosCentOS 6.6實(shí)現(xiàn)永久修改DNS地址的方法

    CentOS 6.6實(shí)現(xiàn)永久修改DNS地址的方法

    這篇文章主要介紹了CentOS 6.6實(shí)現(xiàn)永久修改DNS地址的方法,涉及針對(duì)CentOS配置文件的相關(guān)設(shè)置技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下 ...

    Linux社區(qū)4472020-08-21
  • CentosCentOS7設(shè)置日期和時(shí)間方法以及基本概念介紹

    CentOS7設(shè)置日期和時(shí)間方法以及基本概念介紹

    這篇文章主要介紹了CentOS7設(shè)置日期和時(shí)間方法以及基本概念介紹,本文講解使用CentOS7中的新命令timedatectl設(shè)置日期時(shí)間方法,需要的朋友可以參考下 ...

    CentOS之家6522019-09-19
  • CentosCentOS下Uptime命令詳解

    CentOS下Uptime命令詳解

    在Linux下,我們可以使用uptime命令,而且此命令不必使用root權(quán)限。uptime命令在系統(tǒng)中已經(jīng)默認(rèn)安裝了。今天小編為大家?guī)淼氖荂entOS下Uptime命令詳解;希望...

    CentOS之家11482019-06-19
主站蜘蛛池模板: 成年人观看免费视频 | a黄在线观看 | 国产第一页精品 | 性生活视频网站 | av在线久草 | 久久久久夜色精品国产老牛91 | 欧美日韩亚洲另类 | 国产精品久久久久久一区二区三区 | 蜜桃视频日韩 | 国产超碰人人做人人爱 | 久久6国产| 欧美一级黄色录相 | 亚洲一级电影在线观看 | 黄色大片在线免费观看 | a网在线 | 国产亚洲精品久久久久婷婷瑜伽 | 毛片在哪看 | 久久久国产一区二区三区 | 成人毛片100免费观看 | av电影在线播放 | 午夜小视频免费观看 | 国产午夜免费福利 | 欧洲成人一区 | av免费av| 美女视频黄视大全视频免费网址 | 色视频在线观看 | 综合99| 国产精品久久久久久久四虎电影 | 亚洲成人欧美在线 | 高清av免费 | 在线观看免费污视频 | 亚洲激情91| 日本精品一区二区 | 国产99精品视频 | 日日碰日日操 | 国产色片 | 午夜精品小视频 | 中文字幕免费在线看 | 欧美三级短视频 | 18视频网站在线观看 | 日韩黄色免费观看 |