There's a lot of talk about Docker, the open-source project that lets us manage containers, somewhat like a virtual machine, but in a lighter and more executable way. To familiarize myself more with the technology, and given that someone I consider a Docker expert will likely be joining our team in the coming days, I'm bringing you this article that will teach you how to install Docker on Linux Mint 18 Sarah.
Docker
What is Docker?
Quoting Wikipedia, we can say that " Docker is an open-source project that automates the deployment of applications within software containers, providing an additional layer of abstraction and automation of virtualization at the operating system level in Linux ."
In short, Docker allows us to develop applications without the worry that our code will not work on the machine on which it will run.
How to install Docker on Linux Mint the traditional way
To install the latest version of Docker (docker-engine) on Linux Mint 18 , simply follow the instructions in the Docker user guide . In short, this involves installing the package from the Docker-managed repository.
# Actualizando sudo apt-get update sudo apt-get install apt-transport-https ca-certificates -y # Añadiendo la nueva clave gpg sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D # Añadiendo /etc/apt/sources.list.d/docker.list sudo echo deb https://apt.dockerproject.org/repo ubuntu-xenial main >> /etc/apt/sources.list.d/docker.list # Instalando sudo apt-get update sudo apt-get purge lxc-docker sudo apt-get install linux-image-extra-$(uname -r) -y sudo apt-get install docker-engine cgroup-lite apparmor -y sudo usermod -a -G docker $USER #Ejecutando Docker sudo service docker startsudodocker run hello-world
How to install Docker on Linux Mint automatically
There is a very easy and automatic way to install Docker on Linux Mint , and it basically involves running a routine that executes all the necessary commands. To access and install it this way, you must run the following commands:
# Clonar el repositorio git
git clone https://github.com/ligles/Install-Docker-on-Mint-Sarah.git
# Acceder a la carpeta del script
cd Install-Docker-on-Mint-Sarah
#Dar permiso de ejecución
sudo chmod +x Install-Docker-on-Mint-Sarah.sh
#Ejecutar el Script
./Install-Docker-on-Mint-Sarah.sh
Al final de la instalación el script muestra el siguiente mensaje:
Hola desde Docker!
Este mensaje muestra que su instalación está funcionando correctamente.
Para generar este mensaje, Docker realizó los siguientes pasos:
- El cliente Docker se puso en contacto con el daemon Docker.
- El demonio Docker sacó la imagen de «hello-world» del Docker Hub.
- El demonio Docker creó un nuevo contenedor de esa imagen que ejecuta el ejecutable que produce la salida que está leyendo actualmente.
- El daemon Docker transmitió esa salida al cliente Docker, que la envió a su terminal.
Para probar algo más ambicioso, puedes ejecutar un contenedor de Ubuntu con:
$ docker run -it ubuntu bash
These are definitely a couple of quick ways to install Docker, a technology we should all start learning about and, above all, developing. What do you think about Docker?
Table of Contents