Anda di halaman 1dari 4

6/1/2017 GetStarted,Part1:OrientationandSetup|DockerDocumentation

Get Started, Part 1: Orientation and Setup


Estimated reading time: 3 minutes

1: Orientation (https://docs.docker.com/get-started/) 2: Containers (https://docs.docker.com/get-started/part2/)

3: Services (https://docs.docker.com/get-started/part3/) 4: Swarms (https://docs.docker.com/get-started/part4/)

5: Stacks (https://docs.docker.com/get-started/part5/) 6: Deploy your app (https://docs.docker.com/get-started/part6/)

Welcome! We are excited you want to learn how to use Docker.

In this six-part tutorial, you will:

1. Get set up and oriented, on this page.


2. Build and run your rst app (https://docs.docker.com/get-started/part2/)
3. Turn your app into a scaling service (https://docs.docker.com/get-started/part3/)
4. Span your service across multiple machines (https://docs.docker.com/get-started/part4/)
5. Add a visitor counter that persists data (https://docs.docker.com/get-started/part5/)
6. Deploy your swarm to production (https://docs.docker.com/get-started/part6/)

The application itself is very simple so that you are not too distracted by what the code is doing. After all, the value of Docker is in
how it can build, ship, and run applications; its totally agnostic as to what your application actually does.

Prerequisites
While well dene concepts along the way, it is good for you to understand what Docker is (https://www.docker.com/what-docker)
and why you would use Docker (https://www.docker.com/use-cases) before we begin.

We also need to assume you are familiar with a few concepts before we continue:

IP Addresses and Ports


Virtual Machines
Editing conguration les
Basic familiarity with the ideas of code dependencies and building
Machine resource usage terms, like CPU percentages, RAM use in bytes, etc.

A brief explanation of containers


An image is a lightweight, stand-alone, executable package that includes everything needed to run a piece of software, including the
code, a runtime, libraries, environment variables, and cong les.

A container is a runtime instance of an image what the image becomes in memory when actually executed. It runs completely
isolated from the host environment by default, only accessing host les and ports if congured to do so.

Containers run apps natively on the host machines kernel. They have better performance characteristics than virtual machines that
only get virtual access to host resources through a hypervisor. Containers can get native access, each one running in a discrete
process, taking no more memory than any other executable.

Containers vs. virtual machines


Consider this diagram comparing virtual machines to containers:

Virtual Machine diagram

https://docs.docker.com/getstarted/ 1/4
6/1/2017 GetStarted,Part1:OrientationandSetup|DockerDocumentation

Virtual machines run guest operating systems note the OS layer in each box. This is resource intensive, and the resulting disk
image and application state is an entanglement of OS settings, system-installed dependencies, OS security patches, and other easy-
to-lose, hard-to-replicate ephemera.

Container diagram

https://docs.docker.com/getstarted/ 2/4
6/1/2017 GetStarted,Part1:OrientationandSetup|DockerDocumentation

Containers can share a single kernel, and the only information that needs to be in a container image is the executable and its
package dependencies, which never need to be installed on the host system. These processes run like native processes, and you can
manage them individually by running commands like dockerps just like you would run ps on Linux to see active processes.
Finally, because they contain all their dependencies, there is no conguration entanglement; a containerized app runs anywhere.

Setup
Before we get started, make sure your system has the latest version of Docker installed.

Install Docker
(https://docs.docker.com/engine/installation/)

Note version 1.13 or higher is required

You should be able to run dockerrunhelloworld and see a response like this:

$dockerrunhelloworld

HellofromDocker!
Thismessageshowsthatyourinstallationappearstobeworkingcorrectly.

Togeneratethismessage,Dockertookthefollowingsteps:
...(snipped)...

Now would also be a good time to make sure you are using version 1.13 or higher

https://docs.docker.com/getstarted/ 3/4
6/1/2017 GetStarted,Part1:OrientationandSetup|DockerDocumentation

$dockerversion
Dockerversion17.05.0cerc1,build2878a85

If you see messages like the ones above, youre ready to begin the journey.

Conclusion
The unit of scale being an individual, portable executable has vast implications. It means that CI/CD can push updates to one part of
a distributed application, system dependencies arent a thing you worry about, resource density is increased, and orchestrating
scaling behavior is a matter of spinning up new executables, not new VM hosts. Well be learning about all of those things, but rst
lets learn to walk.

On to Part 2
(https://docs.docker.com/get-
started/part2/)

get started (https://docs.docker.com/glossary/?term=get%20started), setup (https://docs.docker.com/glossary/?term=setup),


orientation (https://docs.docker.com/glossary/?term=orientation), quickstart (https://docs.docker.com/glossary/?term=quickstart),
intro (https://docs.docker.com/glossary/?term=intro), concepts (https://docs.docker.com/glossary/?term=concepts), containers
(https://docs.docker.com/glossary/?term=containers)

Rate this page:


181 13

What is Docker (https://www.docker.com/what-docker)

What is a Container (https://www.docker.com/what-container)

Use Cases (https://www.docker.com/use-cases)

Customers (https://www.docker.com/customers)

Partners (https://www.docker.com/partners/partner-program)

For Government (https://www.docker.com/industry-government)

About Docker (https://www.docker.com/company)

Management (https://www.docker.com/company/management)

Press & News (https://www.docker.com/company/news-and-press)

Careers (https://www.docker.com/careers)

Product (https://www.docker.com/products/overview)

Pricing (https://www.docker.com/pricing)

Community Edition (https://www.docker.com/docker-community)

Enterprise Edition (https://www.docker.com/enterprise)

Docker Datacenter (https://www.docker.com/products/docker-datacenter)

Docker Cloud (https://cloud.docker.com/)

Docker Store (https://store.docker.com/)

Docker for Mac (https://www.docker.com/docker-mac)

Docker for Windows (PC) (https://www.docker.com/docker-windows)

Docker for AWS (https://www.docker.com/docker-aws)

Docker for Azure (https://www.docker.com/docker-microsoft-azure)

https://docs.docker.com/getstarted/ 4/4

Anda mungkin juga menyukai