Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Docker Tutorial

Docker Tutorial

Docker is an open-source application container engine, based on the Go language and open-sourced under the Apache 2.0 license.

Docker allows developers to package their applications and dependencies into a lightweight, portable container, which can then be published to any popular Linux machine, enabling virtualization as well.

Containers use a complete sandbox mechanism and have no interfaces with each other (similar to iPhone apps); more importantly, containers have very low performance overhead.

Since version 17.03, Docker is divided into CE (Community Edition) and EE (Enterprise Edition); the Community Edition is sufficient for us.


Who should read this tutorial?

This tutorial is suitable for operations engineers and backend developers; through it you can learn how to use Docker step by step.


What you need to know before reading this tutorial

Before reading this tutorial, you need to master common Linux commands. You can use the link on this site Linux Tutorial to learn the relevant commands.


Docker application scenarios


Core Advantages


Core Concepts


Basic commands

Example

Pull an image (such as the official Nginx image)

docker pull nginx

Run a container (-d runs in the background, -p maps ports)

docker run

-d

-p

80

:

80

nginx

View running containers

docker

ps

Build an image (based on the Dockerfile in the current directory)

docker build

-t

my-app .

Enter a container

docker

exec

-it

<

Container ID

/

bin

/

bash


Related links

Docker official website:https://www.docker.com

GitHub Docker source code:https://github.com/docker