使用 docker 拉取镜像和创建容器-nginx


本文主要分享通过从docker  hub上获取nginx镜像

 

1、首先查找nginx镜像

[root@node1 ~]# docker search nginx
NAME                                                   DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
nginx                                                  Official build of Nginx.                        8238                [OK]                
jwilder/nginx-proxy                                    Automated Nginx reverse proxy for docker con…   1301                                    [OK]
richarvey/nginx-php-fpm                                Container running Nginx + PHP-FPM capable of…   538                                     [OK]
jrcs/letsencrypt-nginx-proxy-companion                 LetsEncrypt container to use with nginx as p…   335                                     [OK]
kong                                                   Open-source Microservice & API Management la…   170                 [OK]                
webdevops/php-nginx                                    Nginx with PHP-FPM                              97                                      [OK]
kitematic/hello-world-nginx                            A light-weight nginx container that demonstr…   95                                      
zabbix/zabbix-web-nginx-mysql                          Zabbix frontend based on Nginx web-server wi…   48                                      [OK]
bitnami/nginx                                          Bitnami nginx Docker Image                      45                                      [OK]
linuxserver/nginx                                      An Nginx container, brought to you by LinuxS…   33                                      
1and1internet/ubuntu-16-nginx-php-phpmyadmin-mysql-5   ubuntu-16-nginx-php-phpmyadmin-mysql-5          30                                      [OK]
tobi312/rpi-nginx                                      NGINX on Raspberry Pi / armhf                   19                                      [OK]
wodby/drupal-nginx                                     Nginx for Drupal container image                9                                       [OK]
nginxdemos/nginx-ingress                               NGINX Ingress Controller for Kubernetes         8                                       
blacklabelops/nginx                                    Dockerized Nginx Reverse Proxy Server.          8                                       [OK]
webdevops/nginx                                        Nginx container                                 8                                       [OK]
centos/nginx-18-centos7                                Platform for running nginx 1.8 or building n…   6                                       
1science/nginx                                         Nginx Docker images that include Consul Temp…   4                                       [OK]
nginxdemos/hello                                       NGINX webserver that serves a simple page co…   4                                       [OK]
centos/nginx-112-centos7                               Platform for running nginx 1.12 or building …   3                                       
pebbletech/nginx-proxy                                 nginx-proxy sets up a container running ngin…   2                                       [OK]
behance/docker-nginx                                   Provides base OS, patches and stable nginx f…   2                                       [OK]
toccoag/openshift-nginx                                Nginx reverse proxy for Nice running on same…   1                                       [OK]
travix/nginx                                           NGinx reverse proxy                             1                                       [OK]
mailu/nginx                                            Mailu nginx frontend                            0                                       [OK]

 

2、拉取官网的nginx镜像

[root@node1 ~]# docker pull nginx
Using default tag: latest
latest: Pulling from library/nginx
2a72cbf407d6: Pull complete 
fefa2faca81f: Pull complete 
080aeede8114: Pull complete 
Digest: sha256:c4ee0ecb376636258447e1d8effb56c09c75fe7acf756bf7c13efadf38aa0aca
Status: Downloaded newer image for nginx:latest

 

3、查看获取到的镜像文件

[root@node1 ~]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
nginx               latest              7f70b30f2cc6        7 days ago          109MB
ubuntu              14.04               a35e70164dfb        3 weeks ago         222MB
ubuntu              17.10               1af812152d85        3 weeks ago         98.4MB

 

4、启动nginx 容器

[root@node1 ~]# docker run -d -p 80:80 nginx
759d6d37858bcc70867321759df12d2881e6399204f2ba6a4b8b10aaea430da3

 

5、 启动后nginx 验证

到此通过docker 安装nginx完成。 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM