About Docker Core Concepts
Mirroring is a read-only template for the Docker engine that contains the file system.
Mirroring is the basis for creating a container that resembles a sandbox for running and isolating applications.
A container is a running instance of an application created from a mirror, which can be started, started, stopped, deleted, and separated from each other by the container.
Installing Docker on Windows
Download the latest Docker-installer.exe:https://github.com/boot2docker/windows-installer/releases/latest
All options are selected during installation, and the machine is restarted automatically after installation.
After restarting, click "Boot2docker Start" on the desktop to start Docker, while opening VirtualBox will see a virtual machine called Boot2docker running! This is a virtual machine shell used to run Docker on a Windows machine.
When you start Docker, you can see the IP address of the Docker container in this command-line window.
Installing Redis in Docker
To search for a Redis image:
Docker Search Redis
Download Redis image (do not direct Docker pull Redis, because the default tag is latest, if not the tag download will fail, directly select the tag 3.2 redis image to download):
Docker pull Redis:3.2
List existing mirrors:
Docker images
Delete the mirror of the specified ID (turn off the virtual machine power and then restart Docker if it is not deleted):
Docker RMI IMAGE ID
Run the Redis container (specify port number, Dockerfile, execute redis-server command inside the container to start Redis server):
6379:6379 -D Redis:3.2 Redis-server
To view all container start-up conditions:
PS -A
We can see that the Redis container has been started!
Redis can now be accessed with this Docker IP address as the IP address where the Redis server resides.
What benefits does Docker bring?
The Redis server my Flask application relied on was installed on my Mac, so I had to go to work with my Mac every day.
After deploying Redis server in Docker, you don't have to bring your Mac to work from tomorrow onwards.
That's what Docker has to offer me. (? •?_•?)?
And Docker is lightweight and very fast to install, with much less resources compared to installing Redis server in a Linux virtual machine. So I'm using Docker instead of a virtual machine on this machine. Although Docker runs on Windows also relies on a virtual machine shell, this shell is very small, almost negligible, which is the boot2docker virtual machine shell we just saw.
Get a Redis docker container on Windows