{"id":1548,"date":"2018-06-10T14:13:56","date_gmt":"2018-06-10T18:13:56","guid":{"rendered":"http:\/\/www.xavignu.com\/?p=1548"},"modified":"2018-06-10T14:18:06","modified_gmt":"2018-06-10T18:18:06","slug":"docker-in-dietpi","status":"publish","type":"post","link":"https:\/\/www.xavignu.com\/?p=1548","title":{"rendered":"Docker in DietPi"},"content":{"rendered":"<p>So I was trying to install docker in my <a href=\"https:\/\/www.raspberrypi.org\/\" target=\"_blank\">raspberry pi<\/a> with <a href=\"https:\/\/dietpi.com\/\" target=\"_blank\">DietPi<\/a> and initially installed it via repo\/<a href=\"https:\/\/wiki.debian.org\/Aptitude\" target=\"_blank\">aptitude<\/a>, but that version is <a href=\"https:\/\/stackoverflow.com\/questions\/38286313\/docker-on-raspberry-pi-2-could-not-reach-any-registry-endpoint\" target=\"_blank\">pretty old<\/a> and not supported anymore.<\/p>\n<pre id=\"terminal\">dpkg -l | grep dock\r\nii  docker.io                      1.3.3~dfsg1-2              armhf        Linux container runtime \r\n<\/pre>\n<pre id=\"terminal\">sudo docker version \r\nClient version: 1.3.3\r\nClient API version: 1.15\r\nGo version (client): go1.3.2\r\nGit commit (client): d344625\r\nOS\/Arch (client): linux\/arm\r\nServer version: 1.3.3\r\nServer API version: 1.15\r\nGo version (server): go1.3.2\r\nGit commit (server): d344625\r\n<\/pre>\n<p><!--more--><br \/>\nSo with this version of docker gives an error when running a hello-world. So we need to install a newer version and we do this with a simple curl.<\/p>\n<pre id=\"terminal\">curl -sSL https:\/\/get.docker.com | sh\r\n# Executing docker install script, commit: 36b78b2\r\n+ sh -c apt-get update -qq >\/dev\/null\r\n+ sh -c apt-get install -y -qq apt-transport-https ca-certificates curl >\/dev\/null\r\n+ sh -c curl -fsSL \"https:\/\/download.docker.com\/linux\/raspbian\/gpg\" | apt-key add -qq - >\/dev\/null\r\n+ sh -c echo \"deb [arch=armhf] https:\/\/download.docker.com\/linux\/raspbian jessie edge\" > \/etc\/apt\/sources.list.d\/docker.list\r\n+ [ raspbian = debian ]\r\n+ sh -c apt-get update -qq >\/dev\/null\r\n+ sh -c apt-get install -y -qq --no-install-recommends docker-ce >\/dev\/null\r\n+ sh -c docker version\r\nClient:\r\n Version:      18.05.0-ce\r\n API version:  1.37\r\n Go version:   go1.9.5\r\n Git commit:   f150324\r\n Built:        Wed May  9 22:24:32 2018\r\n OS\/Arch:      linux\/arm\r\n Experimental: false\r\n Orchestrator: swarm\r\n\r\nServer:\r\n Engine:\r\n  Version:      18.05.0-ce\r\n  API version:  1.37 (minimum version 1.12)\r\n  Go version:   go1.9.5\r\n  Git commit:   f150324\r\n  Built:        Wed May  9 22:20:36 2018\r\n  OS\/Arch:      linux\/arm\r\n  Experimental: false\r\nIf you would like to use Docker as a non-root user, you should now consider\r\nadding your user to the \"docker\" group with something like:\r\n\r\n  sudo usermod -aG docker your-user\r\n\r\nRemember that you will have to log out and back in for this to take effect!\r\n\r\nWARNING: Adding a user to the \"docker\" group will grant the ability to run\r\n         containers which can be used to obtain root privileges on the\r\n         docker host.\r\n         Refer to https:\/\/docs.docker.com\/engine\/security\/security\/#docker-daemon-attack-surface\r\n         for more information.\r\n<\/pre>\n<p>Now we can test the installation.<\/p>\n<pre id=\"terminal\">docker run hello-world\r\nUnable to find image 'hello-world:latest' locally\r\nlatest: Pulling from library\/hello-world\r\n61ddb93a5f93: Pull complete \r\nDigest: sha256:f5233545e43561214ca4891fd1157e1c3c563316ed8e237750d59bde73361e77\r\nStatus: Downloaded newer image for hello-world:latest\r\n\r\nHello from Docker!\r\nThis message shows that your installation appears to be working correctly.\r\n\r\nTo generate this message, Docker took the following steps:\r\n 1. The Docker client contacted the Docker daemon.\r\n 2. The Docker daemon pulled the \"hello-world\" image from the Docker Hub.\r\n    (arm32v5)\r\n 3. The Docker daemon created a new container from that image which runs the\r\n    executable that produces the output you are currently reading.\r\n 4. The Docker daemon streamed that output to the Docker client, which sent it\r\n    to your terminal.\r\n\r\nTo try something more ambitious, you can run an Ubuntu container with:\r\n $ docker run -it ubuntu bash\r\n\r\nShare images, automate workflows, and more with a free Docker ID:\r\n https:\/\/hub.docker.com\/\r\n\r\nFor more examples and ideas, visit:\r\n https:\/\/docs.docker.com\/engine\/userguide\/\r\n<\/pre>\n<p>Hardware, OS and kernel version below.<\/p>\n<pre id=\"terminal\">uname -a; lsb_release -a\r\nLinux DietPi 4.4.11-v7+ #886 SMP Thu May 19 15:20:49 BST 2016 armv7l GNU\/Linux\r\nNo LSB modules are available.\r\nDistributor ID:\tRaspbian\r\nDescription:\tRaspbian GNU\/Linux 8.0 (jessie)\r\nRelease:\t8.0\r\nCodename:\tjessie\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>So I was trying to install docker in my raspberry pi with DietPi and initially installed it via repo\/aptitude, but that version is pretty old and not supported anymore. dpkg -l | grep dock ii docker.io 1.3.3~dfsg1-2 armhf Linux container runtime sudo docker version Client version: 1.3.3 Client API version: 1.15 Go version (client): go1.3.2 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[92],"tags":[56,83,6,88,96],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/pTQgt-oY","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts\/1548"}],"collection":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1548"}],"version-history":[{"count":7,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts\/1548\/revisions"}],"predecessor-version":[{"id":1556,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts\/1548\/revisions\/1556"}],"wp:attachment":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1548"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1548"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1548"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}