Yun Koriyuki my docker-run your first mirrored instance-docker container

Source: Internet
Author: User
Tags ldap


inside Docker The image is running on the filesystem and the parameters are that it will never change. The container is an instance of the mirror runtime.

when you're in Docker When you run a command on it, he runs the following actions:

1. Check if the image exists

2. if not, download

3. Load the image run the action you want

View Local containers

[[email protected] ~]# docker imagesrepository                                                TAG                  IMAGE ID            CREATED              SIZEcentos7-ssh                                               latest               14a2c2ad7cb1        29 hours ago         320.5   last                 14a2c2ad7cb1         29 hours ago        320.5  MBcentos-ssh                                               latest               b21aa4e2d825         29 hours ago        320.5 MBcentos7sshv1                                              latest              c1a9c3f2f823         30 hours ago         320.5                                last                 00f6c5817350        33 hours ago         191.8 mb

Find containers on the server side

Docker search [image name]

[[email protected] ~]# docker search  nginxname                        description                                       STARS     OFFICIAL   AUTOMATEDnginx                       Official build of Nginx.                         5079       [OK]       jwilder/nginx-proxy        automated nginx reverse proxy for docker c...   915                   [OK]richarvey/nginx-php-fpm    container running nginx + php-fpm capable ...   329                   [ ok]million12/nginx-php       nginx + php-fpm 5.5, 5.6,  7.0  (NG), centos...   75                    [OK]webdevops/php-nginx        Nginx with PHP-FPM                                65                   [ok]maxexcloo/ Nginx-php       framework container with nginx and  PHP-FPM...   58                    [OK]h3nrik/nginx-ldap          NGINX web server with LDAP/AD, SSL and pro...    33                    [ok]bitnami/nginx             bitnami  nginx Docker Image                       22                    [OK]evild/alpine-nginx         minimalistic docker image with nginx             11                    [OK]gists/nginx                Nginx on Alpine                                   8                     [OK]webdevops/nginx            Nginx container                                  7                      [OK]maxexcloo/nginx           Framework  container with nginx installed.       7                     [ok] 1science/nginx            nginx docker  images that include consul te...   4                     [ok]blacklabelops/nginx        Dockerized Nginx Reverse Proxy Server.           4                     [OK]ixbox/nginx                Nginx on Alpine Linux.                            3                     [OK]dock0/nginx                Arch container running nginx                     2                     [OK]servivum/nginx             nginx docker image with useful tools             2                     [OK]frekele/nginx              docker run --rm --name  nginx -p 80:80 -p 4...   2                     [OK]xataz/nginx                Light nginx image                                 2                     [ok]drupaldocker/nginx         NGINX for Drupal                                  2                     [OK]tozd/nginx                 Dockerized nginx.                                 1                     [ok]unblibraries/nginx        baseline  non-php nginx container                 0                     [OK]watsco/nginx               nginx:1.11                                        0                     [OK]c4tech/nginx               several nginx images for web applications.       0                     [ok]funkygibbon/nginx         nginx +  openssl automated build, customisa...   0                     [ok]

Pull container to Local
[[Email protected] ~] #docker pull nginxlatest:pulling fromnginx2c49f83e0b13:pullcomplete4a5e6db8c069: PULLCOMPLETE08ECF065655B:PULLCOMPLETEFF0618BC0767:PULLCOMPLETE12A77B8BF89A:PULLCOMPLETE5DDE53921C3F: Pullcompletea53219dc4d2f:Pullcomplete8c7e9b6e3131:Pullcompletef9bff7d0d06e:Pullcomplete3ac9cfbdf572: PULLCOMPLETE491AEC45EAF8:PULLCOMPLETECD3CF76A61EE:PULLCOMPLETEDIGEST:SHA256: E2dbdc9824482b79050a67c1e6143365d0eeefcc77bf0e22cc2715d91b8d1ad4status:downloadednewer image for Nginx:latest

Running the containerput the inside of the container theport is mapped to the native""
-P Map the container port to local-p [local Port]:[container port][[email protected]~]# Docker run-p NGINX7153768B14E2AB37856D63CCF 2fd15c87f1c57f1f2a456b05131fe923930fce7

View a list of boot containers
[[email protected] ~] #docker  psCONTAINER ID         image               command                 CREATED              STATUS               PORTS                                     NAMES7153768b14e2         nginx                " nginx -g  ' daemon of   7 minutes ago        up 7 minutes        443/tcp,>80/tcp              modest_poincare    b9cb57eb22f9         nginx                 "nginx -g  ' daemon of   9 minutes  ago       up 9 minutes         80/tcp, 443/tcp,>8080/tcp  furious_mccarthy

Operation Container Start, close, restart, killDocker {Start|stop|restart|kill}[CONTAINER ID]
[[Email protected] ~] #docker kill B9cb57eb22f9

Start a container and multiple ports
Docker run-d--name "Web-node1"-P 8022:22-p80:80 nginx/usr/sbin/sshd-d

Mapping local data data into containers

-D Daemon Runs-v mapped data volume-v [local directory]:[in-container directory]docker run-d-it-v/root/www/:/mnt/--name "Web-node2"-p 8024:22-p 80 : nginx/usr/sbin/sshd-d

This article from "Nginxs Small white" blog, reproduced please contact the author!

Yun Koriyuki my docker-run your first mirrored instance-docker container

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.