Some Tips Related to Locally Managing (Saving and Reloading) a Docker Image to Save Bandwidth

Suraiya
3 min readNov 3, 2016

--

Here is my personal note regarding how to save changes to a docker image locally and then reload it with the changes intact instead of fetching components related to the changes from some remote repositories while running it next time. This is to prevent excessive overall monthly bandwidth usage every time my development machine/host restarts due to frequent OS updates and when I need that docker image again after the restart. As for example full Anaconda MNE image for EEG related experiments is not that small and if I try the sample code/example gallery then the system downloads large data set if those are not locally available already. Using the following approach I can make sure that I do not have to face “…” from my “bandwidth police” husband. I read about traffic policing in Tanenbaum’s book -now I see traffic policing of a different form in real life as well. :D

Please note that ideally changes are supposed to be managed by a docker file; and committing/pushing that back to remote repository instead of the way I am doing it. Also there could be data volume based solution but this one is simpler.

Steps:

  1. Get the docker container id (whose image contains your local changes or setup) by running

docker ps -l

And that shows that the container id is 6e49279525e2

2) Locally committing image (docker push would commit it to DockerHub) with changes.

By running

docker commit <containerid> novavic/anaconda_mne

3) The container still does not appear in the list of containers in Kitematic and it would not until we load the image.

However we can see the list of images available by running the command

docker images

4) To load the image run the following:

docker run <necessary options> novavic/anaconda_mne <command>

Now it should appear in KiteMatic.

5) Open Command Line option as well as set port options from KiteMatic, Change values as necessary and save (that from KiteMatic).

Assuming the Docker port 8888 is mapped to host port 32780 and the IP of the system is 192.168.x.y; we would be able to load previously created and saved a Python Notebook from the browser (on the host) as follows:

192.168.x.y:32780/…

--

--

Suraiya

Technology leadership consultation, personal transformation and expansion coach for blissful living.