Questions about using Docker

Hi. I am very new to Docker. I need to know if I understand the following correctly…
1- Docker hub is a repository to store images on. Can I avoid using it and store my images anywhere else i.e USB memory or my hard disk?
2- Docker Desktop is what I need to create images and push them to Docker hub, right?
3- The minimum prerequisites for Docker Desktop are Windows 10. Are there previous versions that I can use on Windows 7? Or is there anyway to make the current version work on Windows 7?
4- What peace of software I’d need to run the created images on another machine - PC, laptop, server or else? For example, I used Docker Desktop to create an image then I needed to run that image on another machine. What would I need to run it?
5- Suppose I created images on Windows 10 using Docker Desktop. Can I run these images on a machine that has windows 7 or the vice versa?

DockerHub is a registry to store images. You can use docker save to export images from your local image cache as tar archive and you can us docker load to load the image from a tar achive back into the local image cache - so yes, you can run docker in an air gapped environment. It is everything but convinent - wouldn’t recommend it, if not absolutly necessary.

On Windows and Mac: yes, on Linux: you have the option to use docker desktop or docker-ce.

No. You can always run a linux vm and run docker-ce in your linux vm. People used to do that before docker desktop was arround.

See answer #2

See answer #3 and #2

1 Like

Thanks for your reply. I am using Windows. If I am using VM’s then there will be no need for Docker Desktop at all. I’ll install my bundle of software on the vm. But that’s what I need to avoid.

  • With “See answer #2”, you meant that Docker Desktop is what I need to run my images on Windows, right?

You don’t run images. You run containers created from images. You need a docker engine to run containers. Docker Desktop always runs the docker engine in a managed linux vm (hidden from the user). Linux can run the docker engine nativly with docker-ce or with Docker Deskop (also in a managed linux vm).

Please be as specific with your answers as possible. Since you haven’t specified your windows version, the answer to you question will be generic (an answer can always be as good as the question…):

Regardless of you OS and version, you can always run the docker engine in a linux vm.
In case of Win10/11 you can use Docker Desktop as a convinient alternative.

1 Like

I can use use Windows 7 or later versions for creating images. And I need to run them on different versions of windows - 7 or later. I want to avoid using VM’s otherwise I would have used it for deploying my bundle of apps without the need of docker.

The docker engine requires Linux to run Linux container. period. So on everything else than docker-ce on a baremetal linux system, there will be a vm involved. With Docker Desktop this vm is hidden from you and managed for you by Docker Desktop.

Docker Desktop on Win 10/11 allows to use WSL2, which will then run the docker engine in a WSL2 linux distribution (completly managed by Docker Desktop) instead of in a vm. Still there is a vm involved, as the WSL2 distribution will be running in a lightweight WSL2 vm (completly managed by WSL2).

With Windows 7 you will either have to manage your own vm and run the docker engine inside the vm, or you can not use docker at all. If running a Linux vm managed by you is not what you want, than Docker is not a solution for your requirements on Windows 7.

Note: on Windows 10/11 you can also run Windows containers, which is not possible with Windows 7 (the Windows 7 kernel doesn’t support it!)

1 Like

@meyay answered everything important. I just wanted to note that there is a difference between running everything directly in a VM without containers and using the VM only to run containers so you can

  • use different Linux distributions, multiple versions of interpreters and build tools.
  • use pre-built Docker images to simplify your configuration
  • enjoy the benefit of filesystem layers and caching
  • have different resource limits for every process easily (you could do it without Docker)

These are just some of the benefits. Of course, if you need only one isolated environment to run one build process from time to time and you don’t expect any compatibility issues, then using Docker could not just be unneccessary, but sometimes undesirable and it might just complicate things more since running applications in containers requires some support from the application. Sometimes you are lucky and you don’t need to change anything, and sometimes it takes weeks to prepare the app to be able to run in containers properly.

2 Likes