Docker

What is Docker?

Docker is an open-source project that automates the deployment of Linux applications inside software containers.

Docker containers wrap up a piece of software in a complete filesystem that contains everything it needs to run: code, runtime, system tools, system libraries, anything you can install on a server. This guarantees that it will always run the same, regardless of the environment it is running in.

Install Docker on Windows

You can find it in here.

Be careful, because installing Docker will inhabilitate using VirtualBox.

Using Docker instead of locally using Redis

For this project, instead of using a Redis' local port, we will be using a Redis machine inside a Docker container.

  • Once Docker is installed on our computer, we need to open a console instance (windows console, powershell, etc).
  • If we type "docker" a list of all the disponible commands will display.
  • First thing to do is download the redis image from the docker repository
  • docker pull redis
    
  • Then we need to start a machine using the previously download image, and opening the ports we will be using (6379 by default):
  • docker run -p 6379:6379 redis
    
  • Then we can start working as if the server were running locally.
  • To stop the machine we need to stop the current process (Control + C) and then stop the machine using it's ID or it's name.
  • docker stop (id/name)
    
  • We can find our machine's ID and name, using the "ps" command, which displays all running machines.

  • docker ps
    

results matching ""

    No results matching ""