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
- Ubuntu 18.04 LTS安裝numbaUbuntu
- Ubuntu 18.04 安裝配置 MySQL 5.7UbuntuMySql
- Ubuntu18.04安裝NginxUbuntuNginx
- Ubuntu18.04安裝GhostUbuntu
- ubuntu18.04安裝dockerceUbuntuDocker
- Ubuntu Docker 安裝UbuntuDocker
- ubuntu 安裝 dockerUbuntuDocker
- ubuntu安裝dockerUbuntuDocker
- Ubuntu18.04基礎安裝Ubuntu
- Ubuntu18.04安裝WikijsUbuntuJS
- Ubuntu 18.04 需要安裝的軟體Ubuntu
- ubuntu18.04 上安裝jdkUbuntuJDK
- Ubuntu18.04安裝BeyondCompareUbuntu
- ubuntu18.04 安裝jenkinsUbuntuJenkins
- 在Ubuntu 18.04上安裝TensorflowUbuntu
- ubuntu18.04安裝timeshiftUbuntu
- Docker安裝LNMP-ubuntu18.04+nginx1.14+mysql5.7+php7.3DockerLNMPUbuntuNginxMySqlPHP
- Ubuntu中安裝DockerUbuntuDocker
- Tool-Docker-Ubuntu18.04DockerUbuntu
- 在 Ubuntu18.04 下 安裝 RedisUbuntuRedis
- Ubuntu18.04安裝wps officeUbuntu
- Ubuntu18.04 安裝JDK1.8UbuntuJDK
- Ubuntu 安裝 docker[laradock]UbuntuDocker
- Ubuntu安裝docker筆記UbuntuDocker筆記
- Ubuntu 安裝 Docker DesktopUbuntuDocker
- 【ubuntu】22.04安裝dockerUbuntuDocker
- ubuntu 安裝指定版本dockerUbuntuDocker
- Ubuntu24.04安裝DockerUbuntuDocker
- Install Docker CE for Ubuntu 18.04 LTSDockerUbuntu
- Ubuntu18.04安裝/解除安裝NVIDIA顯示卡驅動Ubuntu
- 教你如何在 Ubuntu 18.04 中安裝 gThumb 3.9.1Ubuntu
- Ubuntu 18.04 Desktop 安裝搜狗輸入法Ubuntu
- Ubuntu 18.04安裝搜狗輸入法筆記Ubuntu筆記