I can’t seem to wrap my head around (Docker) containers and especially their maintenance.
As I understand it, containers contain a stripped-down OS that shares some resources with the host?
Or is it more like a closed-off part of the file system?
Anyway, when I have several containers running on a host system,
Do I need to keep them all updated separately? If so, how?
Or is it enough to update the host system, and not worry about the containers?
I still don’t understand! I feel so dumb when it comes to docker.
I’m writing an application in Django (a python web framework), and there are docker images for that. But somehow my code needs to get in there I guess? Or does my code go alongside the container in a predefined folder? When I’m developing and need to update the docker container over and over between changes for testing, am I crating a whole new container or updating the one I made originally?
I don’t even get the purpose of the million images on docker hub. What’s the difference between a MySQL image and requiring MySQL in a docker compose and making my own image?
So sorry to bother you with this but I’m thinking you might be able to help me understand. I understood packages, jails, and VMs but this is a whole other thing, lol.
You would run “docker build” to create your image. Maybe around the top of your source tree. That would have a step which copies your code into a directory which will be part of the built image.
Though as another reply mentions, for dev purposes (probably not for production) you could create a mount point / volume which mounts the source dir from your host inside of the container. This will allow you to make changes to your source code on your host without having to re-run “docker build” every time.
That sounds helpful, I’ll give it a try. Thank you, friend.