{"id":1321,"date":"2016-11-20T16:10:59","date_gmt":"2016-11-20T16:10:59","guid":{"rendered":"http:\/\/62.131.51.129\/?p=1321"},"modified":"2016-11-20T16:10:59","modified_gmt":"2016-11-20T16:10:59","slug":"docker-container","status":"publish","type":"post","link":"http:\/\/archief.van-maanen.com\/?p=1321","title":{"rendered":"Docker container"},"content":{"rendered":"<p>Only this weekend I downloaded a Docker package from https:\/\/docs.docker.com\/docker-for-windows. This package allows you to run very small light weight containers on your server than act as components to perform a certain task. In a way, it looks like a virtual machine. It has no direct connect connection to the host machine and it runs in isolation.<br \/>\nOnce it is installed, one only notices a small icon in the task bar that shows its presence.<br \/>\n<a href=\"http:\/\/62.131.51.129\/wp-content\/uploads\/2016\/11\/Untitled.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/62.131.51.129\/wp-content\/uploads\/2016\/11\/Untitled.png\" alt=\"untitled\" width=\"433\" height=\"47\" class=\"alignnone size-full wp-image-1325\" \/><\/a><br \/>\nTo turn it in something useful, one must create a directory with a so-called &#8220;Dockerfile&#8221; in it. In that dockerfile one may store a series of commands that indicate what the Dockerfile container is supposed to do. <a href=\"http:\/\/62.131.51.129\/wp-content\/uploads\/2016\/11\/Dockerfile\">An example of such file can be found here<\/a> On my machine, the directory looks like this:<br \/>\n<a href=\"http:\/\/62.131.51.129\/wp-content\/uploads\/2016\/11\/Untitled-1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/62.131.51.129\/wp-content\/uploads\/2016\/11\/Untitled-1.png\" alt=\"untitled\" width=\"729\" height=\"661\" class=\"alignnone size-full wp-image-1331\" \/><\/a><br \/>\nThe container is then created with:<\/p>\n<pre>\ndocker build -t mysql .\n<\/pre>\n<p>The container can then be started from the command line with:<\/p>\n<pre>\ndocker run --name mysql -e MYSQL_ROOT_PASSWORD=bonvegni -d mysql:8\n<\/pre>\n<p>To get access to the container, one uses this command:<\/p>\n<pre>\ndocker exec -it mysql bash\n<\/pre>\n<p><a href=\"http:\/\/62.131.51.129\/wp-content\/uploads\/2016\/11\/Untitled-2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/62.131.51.129\/wp-content\/uploads\/2016\/11\/Untitled-2.png\" alt=\"untitled\" width=\"800\" height=\"132\" class=\"alignnone size-full wp-image-1332\" \/><\/a><br \/>\nThis is as far as I got. I have a MySql database running. I can access this database from within the container. That look normal. But the challenge is how to communicate with this database. Something to figure out.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Only this weekend I downloaded a Docker package from https:\/\/docs.docker.com\/docker-for-windows. This package allows you to run very small light weight containers on your server than act as components to perform a certain task. In a way, it looks like a virtual machine. It has no direct connect connection to the host machine and it runs [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1322,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1321","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts\/1321","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1321"}],"version-history":[{"count":0,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=\/wp\/v2\/posts\/1321\/revisions"}],"wp:attachment":[{"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1321"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1321"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/archief.van-maanen.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1321"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}