ubuntu 18.04 安裝docker
修改apt源
# sudo vim /etc/apt/sources.list deb deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb deb deb deb-src deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb-src deb-src deb-src deb deb-src deb deb-src deb deb-src deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-security main restricted universe multiverse deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-security main restricted universe multiverse deb deb-src # sudo apt-get update # sudo apt-get upgrade
安裝依賴庫
# sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
新增Docker官方GPG key
# curl -fsSL | sudo apt-key add -
設定Docker穩定版倉庫
# sudo add-apt-repository "deb [arch=amd64] (lsb_release -cs) stable"
更新apt源索引
# sudo apt-get update
安裝最新版Docker CE(社群版)
# sudo apt-get install -y docker-ce
檢查Docker CE是否安裝正確,出現 Hello from Docker! ,則表示安裝成功
# sudo docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 1b930d010525: Pull complete Digest: sha256:4df8ca8a7e309c256d60d7971ea14c27672fc0d10c5f303856d7bc48f8cc17ff 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: For more examples and ideas, visit:
安裝docker-compose
$ sudo curl -L "(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose $ sudo chmod +x /usr/local/bin/docker-compose $ docker-compose version
設定許可權,不用每次都輸入sudo
$ sudo usermod -a -G docker docker
docker常用命令
# # 啟動docker # sudo service docker start # # 停止docker # sudo service docker stop # # 重啟docker # sudo service docker restart
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25357621/viewspace-2665604/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ubuntu18.04 安裝dockerUbuntuDocker
- Ubuntu 18.04 安裝最新版 DockerUbuntuDocker
- Ubuntu18.04 安裝 Docker CE 的方法UbuntuDocker
- Ubuntu 18.04系統編譯安裝Docker教程。Ubuntu編譯Docker
- 在 Ubuntu18.04 上安裝 Docker CE (社群版)UbuntuDocker
- ubuntu18.04安裝timeshiftUbuntu
- Ubuntu 18.04 LTS安裝numbaUbuntu
- Ubuntu18.04安裝NginxUbuntuNginx
- Ubuntu18.04安裝GhostUbuntu
- Ubuntu18.04安裝WikijsUbuntuJS
- Ubuntu18.04安裝BeyondCompareUbuntu
- ubuntu18.04安裝dockerceUbuntuDocker
- ubuntu18.04 安裝jenkinsUbuntuJenkins
- Docker安裝LNMP-ubuntu18.04+nginx1.14+mysql5.7+php7.3DockerLNMPUbuntuNginxMySqlPHP
- Ubuntu18.04基礎安裝Ubuntu
- Ubuntu 18.04 安裝配置 MySQL 5.7UbuntuMySql
- ubuntu18.04 上安裝jdkUbuntuJDK
- Ubuntu18.04安裝wps officeUbuntu
- 在Ubuntu 18.04上安裝TensorflowUbuntu
- Ubuntu 18.04 需要安裝的軟體Ubuntu
- 在 Ubuntu18.04 下 安裝 RedisUbuntuRedis
- Linux Ubuntu18.04 安裝配置 clashLinuxUbuntu
- ubuntu18.04安裝matlab2014aUbuntuMatlab
- ubuntu18.04安裝python-pclUbuntuPython
- Ubuntu18.04 安裝JDK1.8UbuntuJDK
- Ubuntu18.04安裝tensorRT部署模型Ubuntu模型
- ubuntu 安裝 dockerUbuntuDocker
- ubuntu安裝dockerUbuntuDocker
- Ubuntu Docker 安裝UbuntuDocker
- Tool-Docker-Ubuntu18.04DockerUbuntu
- ubuntu18.04安裝dns伺服器UbuntuDNS伺服器
- Ubuntu18.04上安裝NS-3Ubuntu
- ubuntu 18.04安裝kalibr(詳細步驟)Ubuntu
- Ubuntu18.04下安裝 Vivado2019.1Ubuntu
- 在Ubuntu 18.04安裝tensorflow 1.12 GPU版本UbuntuGPU
- Ubuntu 18.04 Desktop 安裝搜狗輸入法Ubuntu
- Ubuntu 安裝 Docker DesktopUbuntuDocker
- 【ubuntu】22.04安裝dockerUbuntuDocker