Debian 9安装docker ce
来源:互联网 发布:知乎 如何挑选浴缸 编辑:程序博客网 时间:2024/05/17 08:50
Docker is a free and open-source containerization software that helps to deploy, run applications in a container. The containers are similar to a virtual machine but consume fewer resource, easy to manage and can run anywhere regardless of operating environment it is running in.
Docker uses cgroups and namespace to allow the independent containers to run within a single Linux instance.
This guide will help you installing Docker onDebian 9Stretch. This guide should also work on the previous version, i.e., Debian 8 (Jessie)
Note: Docker needs a 64-bit version of Debian OS and Kernel version should be atleast 3.10.
Docker Editions:
Docker is now available in two editions, namely.
- Community Edition (CE)
- Enterprise Edition (EE)
Here, we will install Docker Comunity Edition (CE) from Docker repository.
Prerequisites:
Uninstall older versions of Docker called “docker”or “docker-engine” along with associated dependencies. If your system does not have a Docker package, skip the below step.
sudo apt-get -y remove docker docker-engine docker.io
Contents such as volumes, images, and networks under /var/lib/docker/ directory are preserved.
Setup Docker Repository:
Install below packages to have “apt” get a support of https method.
sudo apt-get updatesudo apt-get install -y apt-transport-https ca-certificates wget software-properties-common
Add the GPG key for Docker repository on your system.
wget https://download.docker.com/linux/debian/gpg sudo apt-key add gpg
Add the official Docker repository to the system by running below command in the terminal.
echo "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee -a /etc/apt/sources.list.d/docker.list
Update the apt database.
sudo apt-get update
Make sure you are installing Docker from the official repository, not from the default Debian repository.
sudo apt-cache policy docker-ce
You should see the output like below with the Docker repository details.
docker-ce: Installed: (none) Candidate: 17.06.0~ce-0~debian Version table: 17.06.0~ce-0~debian 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 17.03.2~ce-0~debian-stretch 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 17.03.1~ce-0~debian-stretch 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages 17.03.0~ce-0~debian-stretch 500 500 https://download.docker.com/linux/debian stretch/stable amd64 Packages
Install Docker:
Install Docker using the “apt-get” command.
sudo apt-get -y install docker-ce
Control Docker service:
To start Docker, run:
sudo systemctl start docker
To stop Docker service, run:
sudo systemctl stop docker
To restart Docker service, run:
sudo systemctl restart docker
To check the status of Docker service, run:
sudo systemctl status docker
To enable Docker service to autostart on system boot, run:
sudo systemctl enable docker
Verify Docker Installation:
To test the Docker installation, we will run “hello-world” container.
sudo docker run hello-world
Below output confirms that we have correctly installed Docker on Debian OS.
Unable to find image 'hello-world:latest' locallylatest: Pulling from library/hello-worldb04784fba78d: Pull complete Digest: sha256:f3b3b28a45160805bb16542c9531888519430e9e6d6ffc09d72261b0d26ff74fStatus: Downloaded newer image for hello-world:latestHello from Docker!This message shows that your installation appears to be working correctly.
Interested Topics:
READ: How to Install and Configure Docker Swarm on CentOS 7 / Ubuntu 16.04 / Fedora 25
READ: How to Setup Docker Private Registry on CentOS 7 / Ubuntu 16.04 / Fedora 25
Allow Non-root user to run Docker:
By default, to run Docker commands, the user should have root privileges or equivalent privileges via sudo. Sometimes we may need to allow non-root users to run Docker containers, so follow the below steps to allow them to run containers.
Create a group “docker“, if it does not exist.
sudo groupadd docker
Add your user to docker group, replace “raj” with your user name.
sudo useradd raj
Add a user to docker group.
sudo usermod -aG docker raj
Log out and log back in.
You should now be able to run Docker commands without prefixing sudo.
- Debian 9安装docker ce
- Ubuntu安装Docker CE
- Docker CE安装
- Docker CE 安装 Redis
- Docker - debian 7 安装
- Debian 8.2 安装docker
- 安装Docker CE、安装最新版Docker
- ubutun 12.04 安装 Docker CE
- deepin下安装docker-ce
- 二进制文件方式安装Docker-CE
- 手动安装docker-ce版本
- Centos7安装Docker CE版
- CentOS7下安装Docker CE
- centos7 安装 docker ce 和 docker ee
- 【Linux】【Docker】Ubuntu14.04 安装 Docker CE
- ubuntu 安装docker-ce及docker-compose
- 虚拟机安装CentOS 7, 安装Docker CE
- docker 17.06.2-ce安装指南
- Struts防止表单重复提交
- Mysql+Keepalived高可用性双主配置
- 解决java.lang.IncompatibleClassChangeError
- Spring boot学习(1)
- Ubuntu和Windows共享文件
- Debian 9安装docker ce
- 声学特征变换 STC/MLLT
- Python数组与元组个人笔记
- 防止Android点击按钮过快造成多次事件实现原理
- 二、java项目常用工具类之beancopy,bean和map转换工具类
- 解决回调函数里面回调另一个函数,另一个函数的参数需要依赖这个回调函数(promise)
- SSM+shiro
- 单点登录SSO-使用session共享方式
- [编程题] 最大和