Docker-ce+Ubuntu 16.04环境配置
来源:互联网 发布:校园网络安全教育讲座 编辑:程序博客网 时间:2024/05/29 18:27
ubuntu 16.04 install & configure docker-ce
for ubuntu 14.04, do follows first to install extra packages:
$ sudo apt-get install \
linux-image-extra-$(uname -r) \
linux-image-extra-virtual
step one: Set up the repository (no way we have to choose the aliyun docker source here, you know what i mean)
1. Update the apt package index:
$ sudo apt-get update
2. Install packages to allow apt to use a repository over HTTPS:
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
3. Add Docker’s official GPG key:
$ curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
4. set up the stable repository:
$ sudo add-apt-repository \
"deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu \
$(lsb_release -cs) \
stable"
step two: Install Docker ce
1. Update the apt package index:
$ sudo apt-get update
2. Install the latest version of Docker CE:
$ sudo apt-get install docker-ce
3. Verify that Docker CE is installed correctly by running the hello-world image.
$ sudo docker run hello-world
step three: Manage Docker as a non-root user
1. Create the docker group:
$ sudo groupadd docker
2. Add your user to the docker group:
$ sudo usermod -aG docker $USER
3. Log out and log back in so that your group membership is re-evaluated.
4. Verify that you can run docker commands without sudo:
$ docker run hello-world
step four: Change Docker root dir
caution: In oder to save space on root partition, here we change the path from /var/lib/docker to $(path).
if do not split / and home on different hard disk partition when install os, just skip this step
1. add a json file for docker daemon configuration
$ sudo mkdir -p /etc/docker
$ sudo tee -a /etc/docker/daemon.json <<-'EOF'
{
"graph": "/home/xxxx/docker"
}
EOF
3. reload the configuration: (if you are ubuntu 14.04, just sudo reboot and skip 3 & 4)
$ systemctl daemon-reload
4. restart the docker daemon
$ systemctl restart docker.service
5. verify the result:
$ docker info | grep Root
you will see follows:
Docker Root Dir: /home/xxxx/docker
step five: Configure Aliyun Docker accelerator
caution: here take my own applied accelerator url as an example, you can apply a new one on https://cr.console.aliyun.com/#/accelerator
1. add to the json file:
$ sudo tee -a /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://xxxxxx.mirror.aliyuncs.com"]
}
EOF
2. reload the configuration:
$ sudo systemctl daemon-reload
$ sudo systemctl restart docker
step six: Install Nvidia-docker and corresponding Plugin
1. install nvidia-modprobe first:
$ sudo apt install nvidia-modprobe
2. Install nvidia-docker and nvidia-docker-plugin:
$ sudo wget -P /tmp https://github.com/NVIDIA/nvidia-docker/releases/download/v1.0.1/nvidia-docker_1.0.1-1_amd64.deb
$ sudo dpkg -i /tmp/nvidia-docker*.deb && rm /tmp/nvidia-docker*.deb
Warning:
extra step: Uninstall docker ce
1. Uninstall the Docker CE package:
$ sudo apt-get purge docker-ce
2. To delete all images, containers, and volumes:
$ sudo rm -rf /var/lib/docker
if step four is operated, than change the /var/lib/docker to your specified path
for ubuntu 14.04, do follows first to install extra packages:
$ sudo apt-get install \
linux-image-extra-$(uname -r) \
linux-image-extra-virtual
step one: Set up the repository (no way we have to choose the aliyun docker source here, you know what i mean)
1. Update the apt package index:
$ sudo apt-get update
2. Install packages to allow apt to use a repository over HTTPS:
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
3. Add Docker’s official GPG key:
$ curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
4. set up the stable repository:
$ sudo add-apt-repository \
"deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu \
$(lsb_release -cs) \
stable"
step two: Install Docker ce
1. Update the apt package index:
$ sudo apt-get update
2. Install the latest version of Docker CE:
$ sudo apt-get install docker-ce
3. Verify that Docker CE is installed correctly by running the hello-world image.
$ sudo docker run hello-world
step three: Manage Docker as a non-root user
1. Create the docker group:
$ sudo groupadd docker
2. Add your user to the docker group:
$ sudo usermod -aG docker $USER
3. Log out and log back in so that your group membership is re-evaluated.
4. Verify that you can run docker commands without sudo:
$ docker run hello-world
step four: Change Docker root dir
caution: In oder to save space on root partition, here we change the path from /var/lib/docker to $(path).
if do not split / and home on different hard disk partition when install os, just skip this step
1. add a json file for docker daemon configuration
$ sudo mkdir -p /etc/docker
$ sudo tee -a /etc/docker/daemon.json <<-'EOF'
{
"graph": "/home/xxxx/docker"
}
EOF
3. reload the configuration: (if you are ubuntu 14.04, just sudo reboot and skip 3 & 4)
$ systemctl daemon-reload
4. restart the docker daemon
$ systemctl restart docker.service
5. verify the result:
$ docker info | grep Root
you will see follows:
Docker Root Dir: /home/xxxx/docker
step five: Configure Aliyun Docker accelerator
caution: here take my own applied accelerator url as an example, you can apply a new one on https://cr.console.aliyun.com/#/accelerator
1. add to the json file:
$ sudo tee -a /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://xxxxxx.mirror.aliyuncs.com"]
}
EOF
2. reload the configuration:
$ sudo systemctl daemon-reload
$ sudo systemctl restart docker
step six: Install Nvidia-docker and corresponding Plugin
1. install nvidia-modprobe first:
$ sudo apt install nvidia-modprobe
2. Install nvidia-docker and nvidia-docker-plugin:
$ sudo wget -P /tmp https://github.com/NVIDIA/nvidia-docker/releases/download/v1.0.1/nvidia-docker_1.0.1-1_amd64.deb
$ sudo dpkg -i /tmp/nvidia-docker*.deb && rm /tmp/nvidia-docker*.deb
Warning:
extra step: Uninstall docker ce
1. Uninstall the Docker CE package:
$ sudo apt-get purge docker-ce
2. To delete all images, containers, and volumes:
$ sudo rm -rf /var/lib/docker
if step four is operated, than change the /var/lib/docker to your specified path
阅读全文
0 0
- Docker-ce+Ubuntu 16.04环境配置
- ubuntu 16.04 安装docker-ce并配置加速器,让docker运行一个桌面系统
- Ubuntu安装Docker CE
- ubuntu 安装docker-ce及docker-compose
- Docker CE for Ubuntu安装笔记
- ubuntu 16.04 使用docker运行caffe环境
- 实战:使用Docker配置ubuntu下的scrapy爬虫环境
- CentOS7环境下离线搭建最新Docker-CE环境
- ubuntu server 16.04 为docker配置代理
- Docker环境安装配置
- Docker 配置LNMP环境
- ubuntu centos 安装docker ce 依赖清华大学镜像
- docker安装(ubuntu环境)
- 配置 SQL Server CE 开发环境
- Ubuntu16.04安装Docker CE 并配置加速器
- Centos 7.2 安装Docker CE实践并配置加速器
- Docker CE安装及配置国内镜像加速教程
- docker-ce的安装,和镜像的配置
- C#增删改查操作Access数据库之二(数据库的增加)
- tomcat下载安装教程
- mysqldump定时备份脚本
- SSD(Single Shot MultiBox Detector)笔记
- jsp 网站 mysql 数据库连接 tomcat 服务器配置server
- Docker-ce+Ubuntu 16.04环境配置
- 简单写个好理解的Builder设计模式
- sql时间参数输出
- Pie
- 数据结构与算法分析(Java语言描述)(30)—— 有权图的实现
- HDFS实现其高可靠性的策略及机制
- freemarker 模版静态化
- “敲代码”学编程的正确方式
- 《HTTP权威指南》学习笔记(1)第1章HTTP概述(关键词:计算机网络/HTTP)