2

I'm trying to understand the difference between images used in KVM / VMware / VirtualBox and Docker images + containers.

I can use i.e. an Ubuntu ISO to install the entire operating system into i.e. VirtualBox, essentially writing everything into an image file stored somewhere on the machine. Now, if for whatever reason I decide that I want to move the Ubuntu image and run it on a different computer, I can just copy the image to that other computer and run it from there.

Now, Docker also has images that may also have Ubuntu inside running pretty much any application. I have to setup a container that stores all my changes and states. Now, if I want to do the same thing as I did with the VirtualBox image, transfer my Docker image + container to another computer and run it from there, this step seems to be pretty difficult. I can't really understand why.

So my question is, what exactly is the conceptional difference between Docker images and the other ones mentioned above? Why can't I just copy those images around machines as I please?

2
  • Just google "docker vs virtualbox" for example, you'll find plenty of information there. e.g.: smarthomebeginner.com/what-is-docker-docker-vs-virtualbox . (disclaimer: I didn't read the article, only the gist...) Commented Apr 19, 2018 at 12:18
  • @Lenniey Thanks for the link, I'll take a look at that. Commented Apr 19, 2018 at 12:31

1 Answer 1

2

Docker is used to run microservices, where it uses the resource isolation features of the Linux kernel such as cgroups and kernel namespaces, and a union-capable file system such as OverlayFSand others to allow independent "containers" to run within a single Linux instance, avoiding the overhead of starting and maintaining virtual machines (VMs). It's quite different from VMs, moving docker image can be as easy, you just need to understand how docker works. Also you can use some orchestration manager that can orchestrate docker containers, such tool is kubernetes with it you get a lot of benefits, it managing of containers much easier.

6
  • Thanks for your input. I understand that Docker has a lower overhead compared to traditional VMs. Is there an easy way to move a docker container without using kubernetes? Commented Apr 19, 2018 at 12:24
  • Yes docker container is ran by image, just run the image on another machine. Commented Apr 19, 2018 at 12:26
  • I mean, is there an easy way to transfer a container (with my changes, i.e. apps I installed) to another computer, so that I can continue my work on the exact same Docker container, but on the other computer? Commented Apr 19, 2018 at 12:29
  • I don't know of such way, other than building new image of your working container and just running it on new machine. I'm sorry if I'm not helpful enough. Commented Apr 19, 2018 at 12:31
  • 2
    Yes, @Socrates, there are ways. For example docker commit. You create an image with your changes, move the image somewhere, create a new container using that image. Commented Apr 19, 2018 at 12:37

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.