Apr 6, 2019

One of common questions that many new developers ask is why Docker and really how to use it.

Now as a junior developer, most likely you need to know a few Docker commands. Docker images should be already made for you and it should not change very often.

Most likely your company’s Docker image would be on a private repo, so you might first need to setup private registry to pull image from. Different companies have different way of doing it; it might simply a private url behind company’s VPN or maybe require login via some CLI tool.

So here are some basic commands to get started with Docker:

## Pull Docker Image
docker pull private_url.internal/image

## Run a command on image. Could be web server or npm run dev
docker run private_url.internal/image command

## Check if image is running
docker ps

## log into container 
docker exec -it conatiner_id bash

Why use Docker?

Mostly because you can standardize on configurations across various machines. Without Docker, each developer would spend hours configuring their operating system. And a simple update might break some dependencies.

Another advantage of Docker is that it is lightweight when compared to full virtualization. I used to use Vagrant with VirtualBox but that was pretty resource intensive.