{"id":246,"date":"2019-03-11T09:00:20","date_gmt":"2019-03-11T09:00:20","guid":{"rendered":"http:\/\/www.hardwarehacker.co.uk\/blog\/?p=246"},"modified":"2021-04-07T08:29:56","modified_gmt":"2021-04-07T08:29:56","slug":"docker-part-1-what-is-it","status":"publish","type":"post","link":"https:\/\/www.hardwarehacker.co.uk\/blog\/docker-part-1-what-is-it\/","title":{"rendered":"Docker part 1 &#8211; what is it?"},"content":{"rendered":"<p>Once again this year, we&#8217;ll be making use of docker on the robot.\u00a0 Docker is a linux container system.\u00a0 I&#8217;ll explain how we use Docker in the next post, this post will concentrate on introducing Docker.<\/p>\n<p>Containers are a way of segregating processes.\u00a0 A docker container has its own filesystem, separate from the hosts (though you can mount part of the hosts filesystem into the container if you want to).\u00a0 Processes running inside the container cannot see processes running outside the container (either on the host or in other containers).\u00a0 If you use an appropriate network plugin, it is possible to set up networking for the container too (e.g. so that you can run a web application on port 80 in multiple containers on the same host).\u00a0 The only thing that gets shared between the host and the containers is the host hardware and the linux kernel.<\/p>\n<p>One way of looking at Docker (if you&#8217;re used to python) is that its <code>virtualenv<\/code> on steroids.\u00a0 Virtualenv gives you a local python environment that you can install libraries into without affecting the systemwide python environment (and potentially breaking other packages).\u00a0 A docker container gives you a <em>whole filesystem<\/em> to do stuff in that&#8217;s independent of all the other containers and the host.\u00a0 An example of this: if you have code built to run on Centos, you can install it (and all its dependencies) in a container with Centos and it&#8217;ll just work on a Raspbian host.\u00a0 Or code which worked on an old version of Raspbian, but doesn&#8217;t work on the latest.\u00a0 It makes your code totally independent of what&#8217;s on the host, so long as the host is running the Docker daemon.\u00a0 So I no longer need to be careful about how I setup my SD cards for my robot &#8211; so long as they have Docker, the container will run just the same &#8211; which makes collaborating on different Pis much easier.\u00a0 You never run into problems where &#8220;well it worked on my machine&#8221;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Once again this year, we&#8217;ll be making use of docker on the robot.\u00a0 Docker is a linux container system.\u00a0 I&#8217;ll explain how we use Docker in the next post, this post will concentrate on introducing Docker. Containers are a way of segregating processes.\u00a0 A docker container has its own filesystem, separate from the hosts (though &hellip; <a href=\"https:\/\/www.hardwarehacker.co.uk\/blog\/docker-part-1-what-is-it\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Docker part 1 &#8211; what is it?<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,5,10],"tags":[8,2],"_links":{"self":[{"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/posts\/246"}],"collection":[{"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=246"}],"version-history":[{"count":5,"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/posts\/246\/revisions"}],"predecessor-version":[{"id":334,"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/posts\/246\/revisions\/334"}],"wp:attachment":[{"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}