Learn to use Docker
What is Docker?
Before we go into the world of Docker, we should know the concept of “container” first.
A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another. A Docker container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings.
You can find more in the website shown above in title Container.
What can Docker do?
Docker is a tool designed to make it easier to create, deploy, and run applications by using containers. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and deploy it as one package.
This can be easily installed following the instructions given by docker website.
Your first ‘Hello world’ through Docker
docker run ubuntu:18.04 /bin/echo "Hello world"in terminal. If there’s no image in your computer, docker will download one in Docker Hub.
Communicate with Docker through command line
- Run command
docker run -i -t ubuntu:18.04 /bin/bash
- Enjoy, and you can run
CTRL+Dto exit your container.
Run docker on background
docker run -d ubuntu:18.04 yourcommand
docker psto check your container status.