{"id":2099,"date":"2020-08-11T09:00:11","date_gmt":"2020-08-11T09:00:11","guid":{"rendered":"https:\/\/elasvi.com\/?p=2099"},"modified":"2020-12-20T18:39:22","modified_gmt":"2020-12-20T18:39:22","slug":"instalar-docker-en-linux-debian-10","status":"publish","type":"post","link":"https:\/\/elasvi.com\/index.php\/2020\/08\/11\/instalar-docker-en-linux-debian-10\/","title":{"rendered":"Instalar Docker en Linux (Debian 10)"},"content":{"rendered":"<p>\u00a1Hola! Si prefiere dejar\u00e9 aqu\u00ed un v\u00eddeo con la instalaci\u00f3n.<\/p>\n<p><!-- \/wp:post-content --><!-- wp:paragraph --><\/p>\n<p>Si no, contin\u00fae leyendo.<\/p>https:\/\/youtu.be\/MthFaCHiuko<p><!-- wp:paragraph \/--><!-- wp:paragraph --><\/p>\n<p>Abra una terminal y digite los siguientes comandos (Utilice <strong>CTRL+SHIFT+V<\/strong> para pegar en una terminal):<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:paragraph --><\/p>\n<p>Para evitar poner sudo con cada comando puede escribir<strong> sudo su<\/strong> y poner su contrase\u00f1a.<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:image {\"id\":2101,\"sizeSlug\":\"large\"} --><\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/elasvi.com\/wp-content\/uploads\/2020\/08\/01-2.jpg\" alt=\"\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p>Digite este comando si tiene versiones anteriores de docker, para eliminarlas.<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:code --><\/p>\n<pre><code>sudo apt-get remove docker docker-engine docker.io containerd runc<\/code><\/pre>\n<p><!-- \/wp:code --><!-- wp:image {\"id\":2102,\"sizeSlug\":\"large\"} --><\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/elasvi.com\/wp-content\/uploads\/2020\/08\/02-1.jpg\" alt=\"\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p>Para actualizar las listas de paquetes.<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:code --><\/p>\n<pre><code>sudo apt-get update<\/code><\/pre>\n<p><!-- \/wp:code --><!-- wp:image {\"id\":2103,\"sizeSlug\":\"large\"} --><\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/elasvi.com\/wp-content\/uploads\/2020\/08\/03-1.jpg\" alt=\"\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p>Instalar paquetes para permitir que apt use un repositorio sobre HTTPS:<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:code --><\/p>\n<pre><code>sudo apt-get install \n    apt-transport-https \n    ca-certificates \n    curl \n    gnupg-agent \n    software-properties-common<\/code><\/pre>\n<p><!-- \/wp:code --><!-- wp:image {\"id\":2104,\"sizeSlug\":\"large\"} --><\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/elasvi.com\/wp-content\/uploads\/2020\/08\/04-1.jpg\" alt=\"\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p>Agregue la clave GPG oficial de Docker.<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:code --><\/p>\n<pre><code>curl -fsSL https:\/\/download.docker.com\/linux\/debian\/gpg | sudo apt-key add -<\/code><\/pre>\n<p><!-- \/wp:code --><!-- wp:image {\"id\":2105,\"sizeSlug\":\"large\"} --><\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/elasvi.com\/wp-content\/uploads\/2020\/08\/05-1.jpg\" alt=\"\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p>Verifique que ahora tiene la clave con la huella digital.<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:code --><\/p>\n<pre><code>sudo apt-key fingerprint 0EBFCD88<\/code><\/pre>\n<p><!-- \/wp:code --><!-- wp:paragraph --><\/p>\n<p>Debe salirle esto:<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:image {\"id\":2106,\"sizeSlug\":\"large\"} --><\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/elasvi.com\/wp-content\/uploads\/2020\/08\/06-1.jpg\" alt=\"\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p>Use el siguiente comando para configurar el repositorio estable.<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:code --><\/p>\n<pre><code>sudo add-apt-repository \n   \"deb [arch=amd64] https:\/\/download.docker.com\/linux\/debian \n   $(lsb_release -cs) \n   stable\"<\/code><\/pre>\n<p><!-- \/wp:code --><!-- wp:image {\"id\":2107,\"sizeSlug\":\"large\"} --><\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/elasvi.com\/wp-content\/uploads\/2020\/08\/07.jpg\" alt=\"\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p>\u00a0<\/p>\n<p>Digite el siguiente comando para actualizar las listas de paquetes.<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:code --><\/p>\n<pre><code>sudo apt-get update<\/code><\/pre>\n<p><!-- \/wp:code --><!-- wp:paragraph --><\/p>\n<p>Dice que hay un problema con este directorio, ingrese para corregirlo.<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:image {\"id\":2108,\"sizeSlug\":\"large\"} --><\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/elasvi.com\/wp-content\/uploads\/2020\/08\/08.jpg\" alt=\"\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p>Para ingresar al directorio use un editor de c\u00f3digo, puede utilizar <strong>vim<\/strong> instal\u00e1ndolo con este comando o usar cualquier otro.<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:code --><\/p>\n<pre><code>sudo apt install vim<\/code><\/pre>\n<p><!-- \/wp:code --><!-- wp:paragraph --><\/p>\n<p>Ruta del directorio.<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:code --><\/p>\n<pre><code>sudo vim \/etc\/apt\/sources.list<\/code><\/pre>\n<p><!-- \/wp:code --><!-- wp:image {\"id\":2110,\"sizeSlug\":\"large\"} --><\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/elasvi.com\/wp-content\/uploads\/2020\/08\/09-1.jpg\" alt=\"\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p>Una vez adentro tiene que borrar los repositorios que digan Ubuntu, ya que la instalaci\u00f3n es para Debian.<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:paragraph --><\/p>\n<p>Haga click sobre la l\u00ednea que desee borrar y digite<strong> :d<\/strong><\/p>\n<p><!-- \/wp:paragraph --><!-- wp:paragraph --><\/p>\n<p>Cuando termine digite<strong> :wq<\/strong> para guardar y salir.<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:image {\"id\":2111,\"sizeSlug\":\"large\"} --><\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/elasvi.com\/wp-content\/uploads\/2020\/08\/10.jpg\" alt=\"\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p>Nuevamente digite el siguiente comando para actualizar las listas de paquetes.<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:code --><\/p>\n<pre><code>sudo apt-get update<\/code><\/pre>\n<p><!-- \/wp:code --><!-- wp:image {\"id\":2113,\"sizeSlug\":\"large\"} --><\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/elasvi.com\/wp-content\/uploads\/2020\/08\/11-1.jpg\" alt=\"\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p>Para instalar docker.<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:code --><\/p>\n<pre><code>sudo apt-get install docker-ce docker-ce-cli containerd.io<\/code><\/pre>\n<p><!-- \/wp:code --><!-- wp:image {\"id\":2114,\"sizeSlug\":\"large\"} --><\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/elasvi.com\/wp-content\/uploads\/2020\/08\/12.jpg\" alt=\"\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p>\u00bfDesea continuar? <strong>Si<\/strong><\/p>\n<p><!-- \/wp:paragraph --><!-- wp:paragraph --><\/p>\n<p>\u00a1Listo! Puede verificar que funciona digitando el siguiente comando y seguir us\u00e1ndolo.<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:code --><\/p>\n<pre><code>sudo docker run hello-world<\/code><\/pre>\n<p><!-- \/wp:code --><!-- wp:paragraph --><\/p>\n<p>Ahora, para que docker funcione sin tener que utilizar la palabra<strong> sudo<\/strong>, digite los siguientes comandos.<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:code --><\/p>\n<pre><code>sudo groupadd docker\nsudo usermod -aG docker $USER\nnewgrp docker<\/code><\/pre>\n<p><!-- \/wp:code --><!-- wp:image {\"id\":2115,\"sizeSlug\":\"large\"} --><\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/elasvi.com\/wp-content\/uploads\/2020\/08\/13.jpg\" alt=\"\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p>Con este comando se muestran los contenedores en ejecuci\u00f3n.<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:code --><\/p>\n<pre><code>docker ps<\/code><\/pre>\n<p><!-- \/wp:code --><!-- wp:image {\"id\":2116,\"sizeSlug\":\"large\"} --><\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/elasvi.com\/wp-content\/uploads\/2020\/08\/14.jpg\" alt=\"\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p>Con este comando se muestran todos los contenedores.<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:code --><\/p>\n<pre><code>docker ps -a<\/code><\/pre>\n<p><!-- \/wp:code --><!-- wp:image {\"id\":2117,\"sizeSlug\":\"large\"} --><\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/elasvi.com\/wp-content\/uploads\/2020\/08\/15.jpg\" alt=\"\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p>No hay ninguno. Verifique que docker funciona digitando el siguiente comando, pero ya sin <strong>sudo<\/strong>.<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:code --><\/p>\n<pre><code>docker run hello-world<\/code><\/pre>\n<p><!-- \/wp:code --><!-- wp:image {\"id\":2118,\"sizeSlug\":\"large\"} --><\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/elasvi.com\/wp-content\/uploads\/2020\/08\/16.jpg\" alt=\"\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p>Si le aparece este mensaje quiere decir que est\u00e1 funcionando correctamente, puede digitar los comandos anteriores para verificar que ya hay contenedores.<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:image {\"id\":2119,\"sizeSlug\":\"large\"} --><\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/elasvi.com\/wp-content\/uploads\/2020\/08\/17.jpg\" alt=\"\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:image {\"id\":2120,\"sizeSlug\":\"large\"} --><\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/elasvi.com\/wp-content\/uploads\/2020\/08\/18.jpg\" alt=\"\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p>Con este comando puede ver las im\u00e1genes que tiene.<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:code --><\/p>\n<pre><code>docker images<\/code><\/pre>\n<p><!-- \/wp:code --><!-- wp:image {\"id\":2121,\"sizeSlug\":\"large\"} --><\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/elasvi.com\/wp-content\/uploads\/2020\/08\/19.jpg\" alt=\"\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p>Si desea remover la imagen instalada anteriormente, digite el siguiente comando.<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:code --><\/p>\n<pre><code>docker image rm hello-world<\/code><\/pre>\n<p><!-- \/wp:code --><!-- wp:paragraph --><\/p>\n<p>Aparece este problema porque necesita borrar el contenedor primero para poder borrar la imagen.<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:image {\"id\":2122,\"width\":1063,\"height\":43,\"sizeSlug\":\"large\"} --><\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/elasvi.com\/wp-content\/uploads\/2020\/08\/20.jpg\" alt=\"\" width=\"1063\" height=\"43\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p>Digite docker rm y el nombre del contenedor.<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:image {\"id\":2123,\"width\":1069,\"height\":28,\"sizeSlug\":\"large\"} --><\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/elasvi.com\/wp-content\/uploads\/2020\/08\/21.jpg\" alt=\"\" width=\"1069\" height=\"28\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p>Ya puede borrar la imagen.<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:image {\"id\":2124,\"width\":1066,\"height\":71,\"sizeSlug\":\"large\"} --><\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/elasvi.com\/wp-content\/uploads\/2020\/08\/22.jpg\" alt=\"\" width=\"1066\" height=\"71\" \/><\/figure>\n<p><!-- \/wp:image --><!-- wp:paragraph --><\/p>\n<p>\u00a1Listo!<\/p>\n<p><!-- \/wp:paragraph --><!-- wp:paragraph --><\/p>\n<p>Saludos<\/p>\n<p><!-- \/wp:paragraph --><\/p>\t\t\n<!-- Anuncio horizontal -->\n<ins\n     style=\"display:block\"\n     data-ad-client=\"ca-pub-2225321393472807\"\n     data-ad-slot=\"8599611374\"\n     data-ad-format=\"auto\"\n     data-full-width-responsive=\"true\"><\/ins>","protected":false},"excerpt":{"rendered":"<p>\u00a1Hola! Si prefiere dejar\u00e9 aqu\u00ed un v\u00eddeo con la instalaci\u00f3n. Si no, contin\u00fae leyendo. https:\/\/youtu.be\/MthFaCHiuko Abra una terminal y digite los siguientes comandos (Utilice CTRL+SHIFT+V para pegar en una terminal): Para evitar poner sudo con cada comando puede escribir sudo su y poner su contrase\u00f1a. Digite este comando si tiene versiones anteriores de docker, para [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2126,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[57,80,14],"tags":[11,81,7],"class_list":["post-2099","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debian","category-docker","category-linux","tag-debian-10","tag-docker","tag-linux"],"_links":{"self":[{"href":"https:\/\/elasvi.com\/index.php\/wp-json\/wp\/v2\/posts\/2099","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elasvi.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elasvi.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elasvi.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elasvi.com\/index.php\/wp-json\/wp\/v2\/comments?post=2099"}],"version-history":[{"count":13,"href":"https:\/\/elasvi.com\/index.php\/wp-json\/wp\/v2\/posts\/2099\/revisions"}],"predecessor-version":[{"id":2528,"href":"https:\/\/elasvi.com\/index.php\/wp-json\/wp\/v2\/posts\/2099\/revisions\/2528"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/elasvi.com\/index.php\/wp-json\/wp\/v2\/media\/2126"}],"wp:attachment":[{"href":"https:\/\/elasvi.com\/index.php\/wp-json\/wp\/v2\/media?parent=2099"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elasvi.com\/index.php\/wp-json\/wp\/v2\/categories?post=2099"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elasvi.com\/index.php\/wp-json\/wp\/v2\/tags?post=2099"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}