Docker basics

Alex Objelean bio photo By Alex Objelean

Docker is an open-source engine which automates the deployment of applications as highly portable, self-sufficient containers which are independent of hardware, language, framework, packaging system and hosting provider.

There is a interesting blog post about how to use Docker to install Drupal. After reading it, gives you an good starting point for trying docker on your local environment. Be aware that docker works only on 64bit processors.

The most common Docker commands are listed below:

  • List images
docker images
  • List running containers
docker ps
  • List all available containers
docker ps -a
  • Pull an image named centos
docker pull centos
  • Run container named centos
docker run -i -t centos /bin/bash
  • Run a container and apply port forwarding (port 80)
docker run -i -t -p :80 LAMP /bin/bash
  • Tag a container state
docker tag 26d9b3e0438f631b2f030eedffb6b14216261c9e4ecab0 LAMP drupal