Docker part – 01

Basics

Step 1 - Clone
docker run --name repo alpine/git clone \
https://github.com/docker/getting-started.git

docker cp repo:/git/getting-started/ .

Step 2 - Build
cd getting-started
docker build -t docker101tut .

Step 3 - Run
docker run -d -p 80:80 \
--name docker-tutorial docker101tut

Step 4 - Share
// Save and share your image on docker Hub to enable other users to easily7 download and run the image on any machine
docker tag docker101tut {user}/docker101tut
docker push {user}/docker

Documentation: https://docs.docker.com/engine/install/

Linux Install: https://docs.docker.com/install/linux/linux-postinstall/

Test Docker version

  1. Run you have a supported version of Docker:
    docker --version
    Docker version 17.12.0-ce, build c97c6d6
  2. Run docker info (or docker version without --) to view even more details about your Docker installation:
    docker info
    Containers: 0 Running: 0 Paused: 0 Stopped: 0 Images: 0 Server Version: 17.12.0-ce Storage Driver: overlay2 ...

Command List CLI

docker
docker container --help

## Display Docker version and info
docker --version
docker version
docker info

## Execute Docker image
docker run hello-world

## List Docker images
docker image ls

## List Docker containers (running, all, all in quiet mode)
docker container ls
docker container ls --all
docker container ls -aq

Was this article helpful?

Leave A Comment?