最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Docker容器的使用方法簡單示例

 更新時間:2021年07月24日 09:53:25   作者:jks212454  
這篇文章主要介紹了Docker容器的使用方法簡單示例,包括拉取鏡像、運行鏡像、測試容器內(nèi)的應(yīng)用、檢查主機端口及停止容器的操作方法,本文給大家介紹的非常詳細,需要的朋友可以參考下

一、拉取鏡像

1.檢測鏡像是否存在

[root@node1 ~]# docker search nginx
NAME                              DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
nginx                             Official build of Nginx.                        15187     [OK]       
jwilder/nginx-proxy               Automated Nginx reverse proxy for docker con…   2048                 [OK]
richarvey/nginx-php-fpm           Container running Nginx + PHP-FPM capable of…   816                  [OK]
jc21/nginx-proxy-manager          Docker container for managing Nginx proxy ho…   218                  
linuxserver/nginx                 An Nginx container, brought to you by LinuxS…   149                  
tiangolo/nginx-rtmp               Docker image with Nginx using the nginx-rtmp…   136                  [OK]
jlesage/nginx-proxy-manager       Docker container for Nginx Proxy Manager        123                  [OK]
alfg/nginx-rtmp                   NGINX, nginx-rtmp-module and FFmpeg from sou…   102                  [OK]
jasonrivers/nginx-rtmp            Docker images to host RTMP streams using NGI…   92                   [OK]
nginxdemos/hello                  NGINX webserver that serves a simple page co…   70                   [OK]
privatebin/nginx-fpm-alpine       PrivateBin running on an Nginx, php-fpm & Al…   56                   [OK]
nginx/nginx-ingress               NGINX and  NGINX Plus Ingress Controllers fo…   55                   
nginxinc/nginx-unprivileged       Unprivileged NGINX Dockerfiles                  45                   
staticfloat/nginx-certbot         Opinionated setup for automatic TLS certs lo…   24                   [OK]
nginx/nginx-prometheus-exporter   NGINX Prometheus Exporter for NGINX and NGIN…   19                   
schmunk42/nginx-redirect          A very simple container to redirect HTTP tra…   19                   [OK]
centos/nginx-112-centos7          Platform for running nginx 1.12 or building …   15                   
centos/nginx-18-centos7           Platform for running nginx 1.8 or building n…   13                   
raulr/nginx-wordpress             Nginx front-end for the official wordpress:f…   13                   [OK]
bitwarden/nginx                   The Bitwarden nginx web server acting as a r…   11                   
flashspys/nginx-static            Super Lightweight Nginx Image                   10                   [OK]
mailu/nginx                       Mailu nginx frontend                            9                    [OK]
sophos/nginx-vts-exporter         Simple server that scrapes Nginx vts stats a…   7                    [OK]
ansibleplaybookbundle/nginx-apb   An APB to deploy NGINX                          2                    [OK]
wodby/nginx                       Generic nginx                                   1

2.拉取下載鏡像

[root@node1 ~]# docker pull nginx
Using default tag: latest
latest: Pulling from library/nginx
b4d181a07f80: Pull complete 
66b1c490df3f: Pull complete 
d0f91ae9b44c: Pull complete 
baf987068537: Pull complete 
6bbc76cbebeb: Pull complete 
32b766478bc2: Pull complete 
Digest: sha256:353c20f74d9b6aee359f30e8e4f69c3d7eaea2f610681c4a95849a2fd7c497f9
Status: Downloaded newer image for nginx:latest
docker.io/library/nginx:latest

3.查看本地鏡像

[root@node1 ~]# docker image ls
REPOSITORY   TAG       IMAGE ID       CREATED       SIZE
nginx        latest    4cdc5dd7eaad   2 weeks ago   133MB

二、運行鏡像

1.安裝相關(guān)包

[root@node1 ~]# yum install -y libseccomp-devel 
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Repository AppStream is listed more than once in the configuration
Repository AppStream is listed more than once in the configuration
Repository BaseOS is listed more than once in the configuration
Repository AppStream is listed more than once in the configuration
Repository BaseOS is listed more than once in the configuration
Docker CE Nightly - Sources                                                                                    798  B/s | 2.3 kB     00:02    
ansiable                                                                                                       0.0  B/s |   0  B     00:00    
Failed to synchronize cache for repo 'docker-ce-nightly-source', ignoring this repo.
Failed to synchronize cache for repo 'ansiable', ignoring this repo.
Last metadata expiration check: 2:32:21 ago on Wed 21 Jul 2021 07:51:23 PM CST.
Dependencies resolved.
===============================================================================================================================================
 Package                                Arch                         Version                             Repository                       Size
===============================================================================================================================================
Installing:
 libseccomp-devel                       x86_64                       2.5.1-1.el8                         AppStream                        57 k
Upgrading:
 libseccomp                             x86_64                       2.5.1-1.el8                         base                             71 k

Transaction Summary
===============================================================================================================================================
Install  1 Package
Upgrade  1 Package

Total download size: 128 k
Downloading Packages:
(1/2): libseccomp-2.5.1-1.el8.x86_64.rpm                                                                       256 kB/s |  71 kB     00:00    
(2/2): libseccomp-devel-2.5.1-1.el8.x86_64.rpm                                                                 186 kB/s |  57 kB     00:00    
-----------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                          414 kB/s | 128 kB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                       1/1 
  Upgrading        : libseccomp-2.5.1-1.el8.x86_64                                                                                         1/3 
  Running scriptlet: libseccomp-2.5.1-1.el8.x86_64                                                                                         1/3 
  Installing       : libseccomp-devel-2.5.1-1.el8.x86_64                                                                                   2/3 
  Cleanup          : libseccomp-2.3.3-3.el8.x86_64                                                                                         3/3 
  Running scriptlet: libseccomp-2.3.3-3.el8.x86_64                                                                                         3/3 
  Verifying        : libseccomp-devel-2.5.1-1.el8.x86_64                                                                                   1/3 
  Verifying        : libseccomp-2.5.1-1.el8.x86_64                                                                                         2/3 
  Verifying        : libseccomp-2.3.3-3.el8.x86_64                                                                                         3/3 
Installed products updated.

Upgraded:
  libseccomp-2.5.1-1.el8.x86_64                                         

Installed:
  libseccomp-devel-2.5.1-1.el8.x86_64                                                                                                         
Complete!

2.生成容器

備注:- d 后臺運行容器
-p 80:80 端口映射 宿主機端口:容器內(nèi)端口 
[root@node1 ~]# docker run -d -p 80:80 nginx
2716e3ec14173a31d8c2168ceceefbbfecec0efe6d611bc710df0bc53748ef0c

3.查看容器運行狀態(tài)

[root@node1 ~]# docker ps
CONTAINER ID   IMAGE     COMMAND                  CREATED          STATUS          PORTS                               NAMES
2716e3ec1417   nginx     "/docker-entrypoint.…"   26 seconds ago   Up 24 seconds   0.0.0.0:80->80/tcp, :::80->80/tcp   naughty_driscoll

三、測試容器內(nèi)的應(yīng)用

在這里插入圖片描述

四、檢查宿主機端口

[root@node1 ~]# netstat -tunlp |grep 80
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      3807/docker-proxy   
tcp6       0      0 :::80                   :::*                    LISTEN      3814/docker-proxy   
tcp6       0      0 :::8081                 :::*                    LISTEN      1092/httpd 

五、停止容器

[root@node1 ~]# docker ps
CONTAINER ID   IMAGE     COMMAND                  CREATED         STATUS         PORTS                               NAMES
2716e3ec1417   nginx     "/docker-entrypoint.…"   6 minutes ago   Up 6 minutes   0.0.0.0:80->80/tcp, :::80->80/tcp   naughty_driscoll
[root@node1 ~]# docker stop 2716e3ec1417 
2716e3ec1417
[root@node1 ~]# docker start 2716e3ec1417 
2716e3ec1417

到此這篇關(guān)于Docker容器的使用方法簡單示例的文章就介紹到這了,更多相關(guān)Docker容器使用內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • Linux系統(tǒng)通過Docker安裝SQL?Server數(shù)據(jù)庫

    Linux系統(tǒng)通過Docker安裝SQL?Server數(shù)據(jù)庫

    這篇文章介紹了Linux系統(tǒng)通過Docker安裝SQL?Server數(shù)據(jù)庫的方法,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2022-03-03
  • Docker部署Node.js的實現(xiàn)示例

    Docker部署Node.js的實現(xiàn)示例

    本文介紹了在服務(wù)器上使用Docker部署Node.js項目,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2024-12-12
  • 基于Docker部署Dubbo+Nacos服務(wù)的過程

    基于Docker部署Dubbo+Nacos服務(wù)的過程

    這篇文章主要介紹了基于Docker部署Dubbo+Nacos服務(wù),本文介紹基于?Docker?部署一套?Dubbo?+?Nacos?的微服務(wù)環(huán)境,并解決容器里的?IP?及端口的訪問問題,需要的朋友可以參考下
    2023-02-02
  • docker安裝使用系列之交叉編譯詳解

    docker安裝使用系列之交叉編譯詳解

    在x86平臺上使用Docker實現(xiàn)跨平臺編譯ARM端程序,需要安裝Docker,拉取包含ARM工具鏈的鏡像,啟動QEMU支持,并使用相應(yīng)的Dockerfile進行構(gòu)建,構(gòu)建完成后,可以運行并測試ARM程序,導(dǎo)出所需文件,若在ARM平臺運行x86鏡像,需使用Rosetta2等工具
    2024-10-10
  • Docker中RocketMQ的安裝與使用詳解

    Docker中RocketMQ的安裝與使用詳解

    這篇文章主要介紹了Docker中RocketMQ的安裝與使用詳解,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-06-06
  • 使用Docker搭建minio的詳細圖文教程

    使用Docker搭建minio的詳細圖文教程

    本文介紹了Docker配置鏡像源的方法,以及如何在Docker中拉取鏡像和創(chuàng)建運行容器,詳細說明了使用MinIO創(chuàng)建Bucket、設(shè)置AccessKey、安裝和配置Cpolar以及SpringBoot集成MinIO的步驟,需要的朋友可以參考下
    2024-10-10
  • docker容器日志查看常用命令及線上日志排查

    docker容器日志查看常用命令及線上日志排查

    這篇文章主要給大家介紹了關(guān)于docker容器日志查看常用命令及線上日志排查的相關(guān)資料, Docker是一種容器化技術(shù),使用它的過程中需要查看Docker的日志輸出來調(diào)試或解決問題,需要的朋友可以參考下
    2024-01-01
  • docker?安裝?Influxdb-relay及配置教程

    docker?安裝?Influxdb-relay及配置教程

    這篇文章主要介紹了docker?安裝?Influxdb-relay及配置教程的相關(guān)資料,需要的朋友可以參考下
    2023-08-08
  • docker覆蓋鏡像默認命令之docker?entrypoint詳解

    docker覆蓋鏡像默認命令之docker?entrypoint詳解

    entrypoint命令就是覆蓋ENTRYPOINT命令的,本文給大家介紹了docker覆蓋鏡像默認命令之docker?entrypoint的相關(guān)知識,需要的朋友可以參考下
    2023-10-10
  • Docker部署Prometheus的實現(xiàn)示例

    Docker部署Prometheus的實現(xiàn)示例

    Prometheus是一款開源的監(jiān)控和告警工具,它可以收集系統(tǒng)的各種指標數(shù)據(jù),如CPU使用率、內(nèi)存使用量等,本文主要介紹了Docker部署Prometheus的實現(xiàn)示例,感興趣的可以了解一下
    2024-08-08

最新評論

镇康县| 从江县| 油尖旺区| 沙坪坝区| 沂水县| 合山市| 固原市| 黔江区| 冀州市| 北碚区| 建阳市| 华池县| 鄄城县| 邢台市| 鹤山市| 博湖县| 浙江省| 大姚县| 平顺县| 湘乡市| 沙河市| 安达市| 马龙县| 广平县| 崇左市| 三台县| 两当县| 安新县| 彭泽县| 志丹县| 房山区| 新沂市| 临清市| 佛山市| 武城县| 白城市| 普陀区| 辽阳县| 莲花县| 缙云县| 绥滨县|