這篇文章主要介紹“CentOS7虛擬機怎么安裝并配置docker套件”,在日常操作中,相信很多人在CentOS7虛擬機怎么安裝并配置docker套件問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”CentOS7虛擬機怎么安裝并配置docker套件”的疑惑有所幫助!接下來,請跟著小編一起來學習吧!
網站建設哪家好,找創新互聯建站!專注于網頁設計、網站建設、微信開發、微信小程序定制開發、集團企業網站建設等服務項目。為回饋新老客戶創新互聯還提供了瀘溪免費建站歡迎大家使用!
1. 打開vmware, 創建虛擬機, 選擇光盤, 下一步
2. 選擇傳統bios
3.自定設置
4.選擇存儲虛擬機的位置,存儲
5. 自定義內存為2g, 磁盤為40gb
6. 開機,選擇install centos 7
7. 選擇語言
8.選擇磁盤
9. 設置預裝軟件
10. 節約內存, 關閉kdump
11. 開啟網絡, 設置主機名
12. 開始安裝
13.設置root用戶密碼, 創建具有sudo權限的用戶并設置密碼 設置管理員用戶
添加具有sudo權限的用戶
等讀條完成
重啟
同意協議
完成設置
登錄
開始使用
安裝成功
調整時區
選擇上海
安裝配置完成, 享受linux吧
centos的優勢并不在圖形化界面上, 如果你喜歡圖形化界面的linux, 這里推薦deepin 和 unbuntu, 如果你對界面的美感要求很高, 建議你試一試號稱最美linux的elementaryos
每次拿到一個全新的centos鏡像的時候,第一件事就是為centos更換國內源, 新增yum源, 吐槽一下, 默認的yum源對常用軟件的支持真的不咋地, 比如我想安裝一個 python-pip
, 對不起, 沒有!
但好在centos也留有余地, 你可以自由地新增一些你喜歡的源, 比如epel(extra packages for enterprise linux)
企業版 linux 附加軟件包(以下簡稱 epel)是一個 fedora 特別興趣小組,用以創建、維護以及管理針對企業版 linux 的一個高質量附加軟件包集,面向的對象包括但不限于 紅帽企業版 linux (rhel)、 centos、scientific linux (sl)、oracle linux (ol) 。 epel 的軟件包通常不會與企業版 linux 官方源中的軟件包發生沖突,或者互相替換文件。epel 項目與 fedora 基本一致,包含完整的構建系統、升級管理器、鏡像管理器等等。
第一步: 更換
1.1備份舊的yum源
sudo mv /etc/yum.repos.d/centos-base.repo /etc/yum.repos.d/centos-base.repo.bak
1.2將以下內容寫入 /etc/yum.repos.d/centos-base.repo
# centos-base.repo # # the mirror system uses the connecting ip address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. you should use this for centos updates # unless you are manually picking other mirrors. # # if the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # # [base] name=centos-$releasever - base baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-7 #released updates [updates] name=centos-$releasever - updates baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-7 #additional packages that may be useful [extras] name=centos-$releasever - extras baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-7 #additional packages that extend functionality of existing packages [centosplus] name=centos-$releasever - plus baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-7
1.3刷新yum源
yum clean all && yum makecache && yum update
但是yum源的軟件還是太少了, 比如我想安裝只有 python-pip
都做不到
第二步: 安裝阿里epel源
yum -y install epel-release wget -o /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo # 刷新yum源 yum clean all && yum makecache && yum update
至此, 我們可以愉快的安裝python-pip了, yum install python-pip
第三步: 安裝docker和docker-compose
1. 安裝docker
# 通過yum源安裝docker sudo yum -y install docker # 啟動docker sudo systemctl start docker # 開機自啟 sudo systemctl enable docker
2. 安裝docker-compose
sudo pip install docker-compose # 安裝成功后查看 sudo docker-compose --version
3. docker 中國官方鏡像加速
修改/etc/docker/daemon.json, 加入以下配置
{ "registry-mirrors": ["https://registry.docker-cn.com"] }
重啟docker
sudo service docker restart
到此,關于“CentOS7虛擬機怎么安裝并配置docker套件”的學習就結束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學習,快去試試吧!若想繼續學習更多相關知識,請繼續關注創新互聯網站,小編會繼續努力為大家帶來更多實用的文章!
本文標題:CentOS7虛擬機怎么安裝并配置docker套件
瀏覽路徑:http://m.kartarina.com/article14/pgoide.html
成都網站建設公司_創新互聯,為您提供微信小程序、微信公眾號、自適應網站、營銷型網站建設、靜態網站、軟件開發
聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯