Ubuntu 20.04 上安裝和使用 Docker的詳細(xì)過(guò)程(安裝包)
安裝前將所有的軟件包上傳到系統(tǒng)的/opt路徑,所有的操作都在/opt目錄下
一、解壓文件
tar -xzvf docker-19.03.0.tgz
二、拷貝解壓后的文件到/usr/bin/下面
cp docker/* /usr/bin/
三、加入系統(tǒng)文件
cat >/etc/systemd/system/docker.service <<-EOF [Unit] Description=Docker Application Container Engine After=network-online.target firewalld.service Wants=network-online.target [Service] Type=notify # the default is not to use systemd for cgroups because the delegate issues still # exists and systemd currently does not support the cgroup feature set required # for containers run by docker ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock ExecReload=/bin/kill -s HUP $MAINPID # Having non-zero Limit*s causes performance problems due to accounting overhead # in the kernel. We recommend using cgroups to do container-local accounting. LimitNOFILE=infinity LimitNPROC=infinity LimitCORE=infinity # Uncomment TasksMax if your systemd version supports it. # Only systemd 226 and above support this version. #TasksMax=infinity TimeoutStartSec=0 # set delegate yes so that systemd does not reset the cgroups of docker containers Delegate=yes # kill only the docker process, not all processes in the cgroup KillMode=process # restart the docker process if it exits prematurely Restart=on-failure StartLimitBurst=3 StartLimitInterval=60s [Install] WantedBy=multi-user.target EOF
四、啟動(dòng)Docker
systemctl daemon-reload && systemctl start docker && systemctl enable docker.service
五、Docker配置文件
編輯daemon.json文件輸入以下內(nèi)容
vim /etc/docker/daemon.json
{ "log-driver":"json-file", "log-opts":{ "max-size" :"10m","max-file":"4" }, "registry-mirrors": ["https://6kx4zyno.mirror.aliyuncs.com"] }
六、重啟Docker
systemctl restart docker
七、檢查Docker是否安裝成功
docker --version
八、總結(jié)
我們已經(jīng)向你展示如何在 Ubuntu 20.04 機(jī)器上安裝 Docker。
想要學(xué)習(xí)更多關(guān)于 Docker 的信息,查閱官方 Docker 文檔。
到此這篇關(guān)于Ubuntu 20.04 上安裝和使用 Docker的詳細(xì)過(guò)程(安裝包)的文章就介紹到這了,更多相關(guān)Ubuntu 20.04使用 Docker內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
- 在Ubuntu?Server?22.04上安裝?Docker的詳細(xì)步驟記錄
- 一文詳解如何在Ubuntu系統(tǒng)中安裝docker
- 一步步詳解如何在Ubuntu?18.04上安裝Docker
- ubuntu22通過(guò)docker安裝wechat啟動(dòng)后無(wú)界面的問(wèn)題及解決方法
- 在Docker中的ubuntu中安裝Python3和Pip的問(wèn)題
- 樹(shù)莓派3B+安裝64位ubuntu系統(tǒng)和docker工具的操作步驟詳解
- Windows10安裝WSL2 Ubuntu20.04并設(shè)置docker環(huán)境的方法
- 在Ubuntu18.04上安裝Docker CE的方法(社區(qū)版)
- 分享Ubuntu19無(wú)法安裝docker源問(wèn)題
- Ubuntu24.04LTS在線(xiàn)安裝Docker引擎的詳細(xì)過(guò)程
相關(guān)文章
詳解修改docker時(shí)區(qū)及docker常用命令
這篇文章主要介紹了詳解修改docker時(shí)區(qū)及docker常用命令,非常具有實(shí)用價(jià)值,需要的朋友可以參考下。2016-12-12docker安裝Elasticsearch7.6集群并設(shè)置密碼的方法步驟
本文主要介紹了docker安裝Elasticsearch7.6集群并設(shè)置密碼,文中通過(guò)示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2021-10-10使用docker在服務(wù)器運(yùn)行多個(gè)php版本
這篇文章主要介紹了利用docker在服務(wù)器運(yùn)行多個(gè)版本php,本文以php7為例,通過(guò)實(shí)例代碼的形式給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2019-04-04docker修改默認(rèn)ip的實(shí)現(xiàn)步驟
在 Docker 中,默認(rèn)的網(wǎng)絡(luò)是 bridge 網(wǎng)絡(luò),它通常使用 172.17.0.0/16 這個(gè)網(wǎng)段,那么如何修改,本文就來(lái)詳細(xì)的介紹下docker修改默認(rèn)ip的實(shí)現(xiàn)步驟,感興趣的可以了解一下2024-02-02基于Docker的MongoDB實(shí)現(xiàn)授權(quán)訪(fǎng)問(wèn)的方法
這篇文章主要介紹了基于Docker的MongoDB實(shí)現(xiàn)授權(quán)訪(fǎng)問(wèn)的方法,需要的朋友可以參考下2017-03-03