关于docker:docker教程系列六

3次阅读

共计 675 个字符,预计需要花费 2 分钟才能阅读完成。

导航

  • docker 概念
  • 手动从镜像运行一个容器
  • 应用 dockerfile 打包镜像
  • 应用 compose 部署多容器利用
  • 给 docker 加上数据长久
  • docker 在服务器部署
  • docker 继续集成和部署

docker 在服务器部署

后面的文章也写过对于服务器怎么部署的

详见: 应用 compose 部署多容器利用

上面是一个装置 docker 的 sh 配置脚本

# 官网装置指南 Ubuntu 版本
# https://docs.docker.com/install/linux/docker-ce/ubuntu

sudo apt update

# docker 的源是 https,所以装置这些软件用于反对 https 的 apt 仓库
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common

# 增加 Docker 的官网 GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

# 设置官网 Docker 源
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

# 装置 Docker
sudo apt update
sudo apt install -y docker-ce

# 如果你想验证 Docker 装置好了,能够运行一个 hello-world 容器
# sudo docker run hello-world
正文完
 0