1. Export whole container as a Tarball (uncompressed)
docker export -o test.tar CONTAINER_NAME
2. Import tarball file as a new container
docker import test.tar
3. Rename a container's name
docker rename OLD_CONTAINER_NAME NEW_CONTAINER_NAME
4. List the processes runnings (runs PS inside container)
docker top CONTAINER_NAME [optional ps parameters]
--- VOLUMES ---
I also understand from command line that each volume created with VOLUME CREATE could can be assigned a NAME and LABELS. Why are the labels all NULL and names so random? Isn't it possible to determine their name during creation based on the CONTAINER name and added "_" and then something at the end? this way you could see in DOCKER VOLUME LS which volume is from which container, and then use comands as DOCKER VOLUME CREATE and DOCKER VOLUME RM to allow some future editing (inserting, removing...) of volumes without the need of recreating everything.
--- NETWORKING ---
About networking, I understand that each time a new container is added into a network (example: a bridge), you have to recreate the whole network... that's what I understood from the command line. OK for now... but if that's how it works... why can't you make possible to edit existing networks? What if we forget a port in a container?
Right... every time any little change will be made in a existing network (inserting or removing ports, for example), the whole network is remade, but there's no actual downside in doing that. Am I wrong?
-- UPGRADING CONTAINERS'S IMAGE --
About upgrading the image and distributing it to related containers, I understand that docker doesn't natively supports a command to do that. But that doesn't mean it can't be done.
But...think with me... plugin knows all the containers configurations... we know it has today to be done manually... Nobody blocks you from scripting the existing manual process of:
- Checking if the image's version is newer than the container's.
- If YES, continue, if NO, stop right here and warn the user.
- Stop the container
- Save it's configurations (volume mapping, environment variables, ports, parameters, name, everything!!) in memory
- Delete this old container
- Recreate a new container with the new image, PLUS all the configuration saved above, exactly all of them
- Start the new container
Thanks for your attention!