Much is said about docker, the open source project that allows us to handle containers, with a certain resemblance to a virtual machine, although in a lighter and more executable way. To become more familiar with the technology and in view that probably in the next few days someone will be added to the team that I consider to be an expert in Docker, I bring this article that will teach us to How to install Docker on Linux Mint 18 Sarah.
What is Docker?
Quoting Wikipedia we can say that «Docker is an open source project which automates application deployment within software containers, providing an additional layer of abstraction and automation of Virtualization at the operating system level on Linux«.
In a nutshell, Docker allows us to develop applications without the worry that our code won't work on the machine it's running on.
How to install Docker on Linux Mint the traditional way
To install the latest version of Docker (docker-engine) on Linux Mint 18, we just have to follow the instructions in the docker usage guide. In short, it is basically installing the package from the repository managed by Docker.
# 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 start
sudo
docker 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 basically it is the execution of a routine that executes all the necessary commands, to access it and install it in this way you must execute 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
Undoubtedly a couple of quick alternatives to install Docker, which is a technology that we must all begin to know and especially to develop. What do you think about Docker?
If the installation in Linux Mint drives you crazy, note that the .sh that you have downloaded does not have half dashes but underscores.
Even following the steps, I only get this error
Failed to start docker.service: Unit docker.service is masked