{"id":6431,"date":"2025-06-24T17:18:05","date_gmt":"2025-06-24T09:18:05","guid":{"rendered":"https:\/\/www.alfredivy.sg\/blogger\/?p=6431"},"modified":"2025-06-24T17:41:27","modified_gmt":"2025-06-24T09:41:27","slug":"docker-for-home-use","status":"publish","type":"post","link":"https:\/\/www.alfredivy.sg\/blogger\/2025\/06\/docker-for-home-use\/","title":{"rendered":"Docker for home use"},"content":{"rendered":"\n<p class=\"has-drop-cap\">I have always wanted to try my hand at containers. Containers are a leaner form of virtualization. It allows the VM to tap onto the host OS rather than running multiple copies of the same OS. Docker is the nice layer of software that helps to hold it together.<\/p>\n\n\n\n<p>My first Docker project to dip my toes in is a book manager called Bibliotheca. It helps you to keep track of the books you have read and statistics. Data input and output via browser, so fairly self-contained and does not block anything.<\/p>\n\n\n\n<p>Installation for Docker is easy.  Just download <a href=\"https:\/\/docs.docker.com\/desktop\/setup\/install\/windows-install\/\" data-type=\"link\" data-id=\"https:\/\/docs.docker.com\/desktop\/setup\/install\/windows-install\/\" target=\"_blank\" rel=\"noreferrer noopener\">Docker Desktop <\/a>and install Windows Subsystem for Linux (WSL).<\/p>\n\n\n\n<p>According to the Bibliotheca\u00a0<a href=\"https:\/\/github.com\/pickles4evaaaa\/mybibliotheca\" data-type=\"link\" data-id=\"https:\/\/github.com\/pickles4evaaaa\/mybibliotheca\" target=\"_blank\" rel=\"noreferrer noopener\">Github <\/a>page, run the following code in the command window.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>docker run -d \\\n  --name mybibliotheca \\\n  -p 5054:5054 \\\n  -v \/path\/to\/data:\/app\/data \\\n  -e TIMEZONE=America\/Chicago \\\n  -e WORKERS=6 \\\n  --restart unless-stopped \\\n  pickles4evaaaa\/mybibliotheca:1.1.1<\/code><\/code><\/pre>\n\n\n\n<p>I converted it to a single long line, and the container was downloaded from Docker Hub and installed. If you used the Docker Desktop GUI to install and left out the port translation, the only way to fix it is to delete the container.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Case matters<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><code>C:\\Users\\Admin&gt;docker run -d --name mybibliotheca -p 5054:5054 -v \/path\/to\/data:\/app\/data -e TIMEZONE=America\/Chicago -e WORKERS=6 --restart unless-stopped pickles4evaaaa\/MyBibliotheca:latest\ndocker: invalid reference format: repository name (pickles4evaaaa\/MyBibliotheca) must be lowercase<\/code><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">A successful install<\/h3>\n\n\n\n<pre class=\"wp-block-code is-style-plain\"><code>C:\\Users\\Admin>docker run -d --name mybibliotheca -p 5054:5054 -v \/path\/to\/data:\/app\/data -e TIMEZONE=America\/Chicago -e WORKERS=6 --restart unless-stopped pickles4evaaaa\/mybibliotheca:latest\n0e41f1fd8e0ef7b11df354c59bf725e11157f2623b3ee16e4318e41371fb5aa9<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">List of downloaded images which containers are based on<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><code>C:\\Users\\Admin&gt;docker images<br>REPOSITORY TAG IMAGE ID CREATED SIZE<br>pickles4evaaaa\/mybibliotheca latest bdeba291d9cb 2 days ago 930MB<\/code><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Downloading a new image to perform an upgrade.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><code>C:\\Users\\Admin&gt;docker pull pickles4evaaaa\/bibliotheca:1.1.0<br>1.1.0: Pulling from pickles4evaaaa\/bibliotheca<br>5f70ed490464: Pull complete<br>920295a7923a: Pull complete<br>733e2cf0f6d8: Pull complete<br>7acd0644573a: Pull complete<br>Digest: sha256:7844b65010f6677cce679c1d7c3fbce9806ace13d5b8792abafbc19c4a64232b<br>Status: Downloaded newer image for pickles4evaaaa\/bibliotheca:1.1.0<br>docker.io\/pickles4evaaaa\/bibliotheca:1.1.0<\/code><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">List of downloaded images and running container<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><code>C:\\Users\\Admin&gt;docker images<br>REPOSITORY TAG IMAGE ID CREATED SIZE<br>pickles4evaaaa\/mybibliotheca latest bdeba291d9cb 2 days ago 930MB<br>pickles4evaaaa\/bibliotheca 1.1.0 7844b65010f6 5 days ago 317MB<\/code><\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code><code>C:\\Users\\Admin>docker ps\nCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES\n0e41f1fd8e0e pickles4evaaaa\/mybibliotheca:latest \"docker-entrypoint.s\u2026\" 3 hours ago Up 3 hours 0.0.0.0:5054->5054\/tcp mybibliotheca<\/code><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Upgrading the container<\/h3>\n\n\n\n<p>Stop the container, delete and start the new version.<\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<pre class=\"wp-block-code\"><code><code>C:\\Users\\Admin>docker stop 0e41f1fd8e0e\n0e41f1fd8e0e<\/code>\nC:\\Users\\Admin>docker rm 0e41f1fd8e0e\n0e41f1fd8e0e<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code><code>C:\\Users\\Admin&gt;docker run -d --name bibliotheca -p 5054:5054 -v \/path\/to\/data:\/app\/data -e TIMEZONE=America\/Chicago -e WORKERS=6 --restart unless-stopped pickles4evaaaa\/bibliotheca:1.1.0<br>3f802e2213104b63f8dfab486bf2cca5e10536947f5e8cd313b72a165f725675<\/code><\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code><code>C:\\Users\\Admin&gt;docker ps<br>CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES<br>3f802e221310 pickles4evaaaa\/bibliotheca:1.1.0 \"sh -c 'gunicorn -w \u2026\" 15 seconds ago Up 15 seconds 0.0.0.0:5054-&gt;5054\/tcp bibliotheca<\/code><\/code><\/pre>\n<\/div><\/div>\n<\/div><\/div>\n\n\n\n<p>The upgrade is very smooth and very resilient.  The data persists even after all the containers and images were deleted.  I wanted to delete all data and start from scratch, but it is not possible.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have always wanted to try my hand at containers. Containers are a leaner form of virtualization. It allows the VM to tap onto the host OS rather than running multiple copies of the same OS. Docker is the nice&hellip; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[499],"tags":[612,611],"class_list":["post-6431","post","type-post","status-publish","format-standard","hentry","category-virtualization","tag-container","tag-docker"],"_links":{"self":[{"href":"https:\/\/www.alfredivy.sg\/blogger\/wp-json\/wp\/v2\/posts\/6431","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.alfredivy.sg\/blogger\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.alfredivy.sg\/blogger\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.alfredivy.sg\/blogger\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.alfredivy.sg\/blogger\/wp-json\/wp\/v2\/comments?post=6431"}],"version-history":[{"count":15,"href":"https:\/\/www.alfredivy.sg\/blogger\/wp-json\/wp\/v2\/posts\/6431\/revisions"}],"predecessor-version":[{"id":6454,"href":"https:\/\/www.alfredivy.sg\/blogger\/wp-json\/wp\/v2\/posts\/6431\/revisions\/6454"}],"wp:attachment":[{"href":"https:\/\/www.alfredivy.sg\/blogger\/wp-json\/wp\/v2\/media?parent=6431"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.alfredivy.sg\/blogger\/wp-json\/wp\/v2\/categories?post=6431"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.alfredivy.sg\/blogger\/wp-json\/wp\/v2\/tags?post=6431"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}