iis服务器助手广告广告
返回顶部
首页 > 资讯 > 精选 >怎么使用docker部署centos系统测试环境
  • 725
分享到

怎么使用docker部署centos系统测试环境

2023-07-05 20:07:30 725人浏览 薄情痞子
摘要

今天小编给大家分享一下怎么使用Docker部署Centos系统测试环境的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。一、检查

今天小编给大家分享一下怎么使用Docker部署Centos系统测试环境的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。

一、检查本地服务器系统版本

[root@node ~]# cat /etc/os-release NAME="CentOS linux"VERSioN="7 (Core)"ID="centos"ID_LIKE="rhel fedora"VERSION_ID="7"PRETTY_NAME="CentOS Linux 7 (Core)"ANSI_COLOR="0;31"CPE_NAME="cpe:/o:centos:centos:7"HOME_URL="https://www.centos.org/"BUG_REPORT_URL="Https://bugs.centos.org/"CENTOS_MANTISBT_PROJECT="CentOS-7"CENTOS_MANTISBT_PROJECT_VERSION="7"REDHAT_SUPPORT_PRODUCT="centos"REDHAT_SUPPORT_PRODUCT_VERSION="7"
[root@node ~]# cat /etc/centos-releaseCentOS Linux release 7.6.1810 (Core)

二、检查docker版本

[root@node ~]# docker versionClient: Docker Engine - CommUnity Version:           20.10.17 api version:       1.41 Go version:        go1.17.11 git commit:        100c701 Built:             Mon Jun  6 23:05:12 2022 OS/Arch:           linux/amd64 Context:           default Experimental:      trueServer: Docker Engine - Community Engine:  Version:          20.10.17  API version:      1.41 (minimum version 1.12)  Go version:       go1.17.11  Git commit:       a89b842  Built:            Mon Jun  6 23:03:33 2022  OS/Arch:          linux/amd64  Experimental:     false containerd:  Version:          1.6.6  GitCommit:        10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1 runc:  Version:          1.1.2  GitCommit:        v1.1.2-0-ga916309 docker-init:  Version:          0.19.0  GitCommit:        de40ad0

三、检查docker状态

[root@node ~]# systemctl status docker● docker.service - Docker Application Container Engine   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)   Active: active (running) since Fri 2022-11-04 09:12:32 CST; 18h ago     Docs: https://docs.docker.com Main PID: 10162 (dockerd)    Tasks: 62   Memory: 3.6G   CGroup: /system.slice/docker.service           ├─10162 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock           ├─21803 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 27217 -container-ip 172.17.0.2 -container-port 27017           ├─21808 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 27217 -container-ip 172.17.0.2 -container-port 27017           ├─33495 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 3548 -container-ip 172.17.0.3 -container-port 3306           ├─33501 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 3548 -container-ip 172.17.0.3 -container-port 3306           ├─43634 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8080 -container-ip 172.17.0.4 -container-port 80           ├─43640 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8080 -container-ip 172.17.0.4 -container-port 80           ├─59700 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8098 -container-ip 172.17.0.5 -container-port 80           └─59705 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8098 -container-ip 172.17.0.5 -container-port 80Nov 04 10:00:54 node dockerd[10162]: time="2022-11-04T10:00:54.645415843+08:00" level=info msg="Attempting next endpoint for pull after ...unknown"Nov 04 11:46:29 node dockerd[10162]: time="2022-11-04T11:46:29.261326827+08:00" level=info msg="Attempting next endpoint for pull after ...unknown"Nov 04 11:47:04 node dockerd[10162]: time="2022-11-04T11:47:04.769147449+08:00" level=info msg="Download failed, retrying (1/5): net/htt...timeout"Nov 04 11:51:16 node dockerd[10162]: time="2022-11-04T11:51:16.548891252+08:00" level=error msg="Not continuing with pull after error: c...anceled"Nov 04 11:55:42 node dockerd[10162]: time="2022-11-04T11:55:42.370401579+08:00" level=info msg="ignoring event" container=ac860c2aa163e2...kDelete"Nov 04 14:31:26 node dockerd[10162]: time="2022-11-04T14:31:26.826919720+08:00" level=warning msg="reference for unknown type: applicati...:latest"Nov 04 14:31:27 node dockerd[10162]: time="2022-11-04T14:31:27.105606415+08:00" level=warning msg="Error persisting manifest" digest="sha256:f2e...Nov 04 14:31:27 node dockerd[10162]: time="2022-11-04T14:31:27.105748609+08:00" level=warning msg="Image docker.io/romainlecomte/lighthttpd-dock...Nov 04 14:45:39 node dockerd[10162]: time="2022-11-04T14:45:39.628278832+08:00" level=error msg="Not continuing with pull after error: m...unknown"Nov 04 14:45:39 node dockerd[10162]: time="2022-11-04T14:45:39.628408475+08:00" level=error msg="Handler for POST /v1.41/images/create r...unknown"Hint: Some lines were ellipsized, use -l to show in full.

四、下载centos镜像

[root@node ~]# docker pull centos:77: Pulling from library/centosDigest: sha256:9d4bcbbb213Dfd745b58be38b13b996ebb5ac315fe75711bd618426a630e0987Status: Image is up to date for centos:7docker.io/library/centos:7

五、创建centos容器

1.运行cnentos容器

[root@node ~]# docker run -it --name centos_test   centos:7 /bin/bash[root@db4f4dfa3a84 /]#

2.进入容器内

[root@node ~]# docker run -it --name centos_test   centos:7 /bin/bash[root@db4f4dfa3a84 /]# lsanaconda-post.log  bin  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var[root@db4f4dfa3a84 /]# pwd/

六、centos容器内部测试

1.安装ifconfig命令的软件包

[root@db4f4dfa3a84 /]# yum -y install net-toolsLoaded plugins: fastestmirror, ovlLoading mirror speeds from cached hostfile * base: mirrors.huaweicloud.com * extras: mirrors.ustc.edu.cn * updates: mirrors.ustc.edu.cnResolving Dependencies--> Running transaction check---> Package net-tools.x86_64 0:2.0-0.25.20131004git.el7 will be installed--> Finished Dependency ResolutionDependencies Resolved=================================================================================================================================================== Package                          Arch                          Version                                          Repository                   Size===================================================================================================================================================Installing: net-tools                        x86_64                        2.0-0.25.20131004git.el7                         base                        306 kTransaction Summary===================================================================================================================================================Install  1 PackageTotal download size: 306 kInstalled size: 917 kDownloading packages:net-tools-2.0-0.25.20131004git.el7.x86_64.rpm                                                                               | 306 kB  00:00:00     Running transaction checkRunning transaction testTransaction test succeededRunning transaction  Installing : net-tools-2.0-0.25.20131004git.el7.x86_64                                                                                       1/1   Verifying  : net-tools-2.0-0.25.20131004git.el7.x86_64                                                                                       1/1 Installed:  net-tools.x86_64 0:2.0-0.25.20131004git.el7                                                                                                      Complete!

2.查看容器内IP地址

[root@db4f4dfa3a84 /]# ifconfigeth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 172.17.0.6 netmask 255.255.0.0 broadcast 172.17.255.255 ether 02:42:ac:11:00:06 txqueuelen 0 (Ethernet) RX packets 7037 bytes 25618849 (24.4 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 4655 bytes 269171 (262.8 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 loop txqueuelen 1000 (Local Loopback) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0[root@db4f4dfa3a84 /]# ifconfigeth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500        inet 172.17.0.6  netmask 255.255.0.0  broadcast 172.17.255.255        ether 02:42:ac:11:00:06  txqueuelen 0  (Ethernet)        RX packets 7037  bytes 25618849 (24.4 MiB)        RX errors 0  dropped 0  overruns 0  frame 0        TX packets 4655  bytes 269171 (262.8 KiB)        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536        inet 127.0.0.1  netmask 255.0.0.0        loop  txqueuelen 1000  (Local Loopback)        RX packets 0  bytes 0 (0.0 B)        RX errors 0  dropped 0  overruns 0  frame 0        TX packets 0  bytes 0 (0.0 B)        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

3.测试与宿主机网络连通情况

[root@db4f4dfa3a84 /]# ping 192.168.3.166 -c 6PING 192.168.3.166 (192.168.3.166) 56(84) bytes of data.64 bytes from 192.168.3.166: icmp_seq=1 ttl=64 time=0.091 ms64 bytes from 192.168.3.166: icmp_seq=2 ttl=64 time=0.130 ms64 bytes from 192.168.3.166: icmp_seq=3 ttl=64 time=0.104 ms64 bytes from 192.168.3.166: icmp_seq=4 ttl=64 time=0.109 ms64 bytes from 192.168.3.166: icmp_seq=5 ttl=64 time=0.075 ms64 bytes from 192.168.3.166: icmp_seq=6 ttl=64 time=0.092 ms--- 192.168.3.166 ping statistics ---6 packets transmitted, 6 received, 0% packet loss, time 5010msrtt min/avg/max/mdev = 0.075/0.100/0.130/0.018 ms

4.让centos容器后台运行

从容器退出,但不停止容器: Ctrl+P+Q

[root@node ~]# docker psCONTAINER ID   IMAGE                                    COMMAND                  CREATED          STATUS          PORTS                                            NAMESdb4f4dfa3a84   centos:7                                 "/bin/bash"              11 minutes ago   Up 11 minutes                                                    centos_test

以上就是“怎么使用docker部署centos系统测试环境”这篇文章的所有内容,感谢各位的阅读!相信大家阅读完这篇文章都有很大的收获,小编每天都会为大家更新不同的知识,如果还想学习更多的知识,请关注编程网精选频道。

--结束END--

本文标题: 怎么使用docker部署centos系统测试环境

本文链接: https://www.lsjlt.com/news/354882.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • 怎么使用docker部署centos系统测试环境
    今天小编给大家分享一下怎么使用docker部署centos系统测试环境的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。一、检查...
    99+
    2023-07-05
  • 关于如何使用docker部署centos系统测试环境
    目录一、检查本地服务器系统版本二、检查docker版本三、检查docker状态四、下载centos镜像五、创建centos容器1.运行cnentos容器2.进入容器内六、centos...
    99+
    2023-05-14
    docker docker部署centos centos系统环境
  • centos怎么搭建部署docker环境
    这篇文章主要介绍“centos怎么搭建部署docker环境”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“centos怎么搭建部署docker环境”文章能帮助大家解决问题。1、Docker的存在解决的...
    99+
    2023-07-02
  • centos怎么部署php环境
    本教程操作环境:CentOS 7系统、PHP8.1版、Dell G3电脑。centos怎么部署php环境?centos安装php环境这次给大家说说我安装部署php环境(我已经成功在使用)1、首先进行yum安装扩展yum install li...
    99+
    2024-04-02
  • centos怎么部署node.js环境
    本篇内容主要讲解“centos怎么部署node.js环境”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“centos怎么部署node.js环境”吧!一 打开cen...
    99+
    2022-11-30
    centos node.js
  • Linux系统环境怎么部署
    本篇内容介绍了“Linux系统环境怎么部署”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!以阿里云为例,默认第一位就是CentOS,提供了从7...
    99+
    2023-06-16
  • 怎么使用Docker快速部署ELK环境
    这篇文章主要介绍“怎么使用Docker快速部署ELK环境”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“怎么使用Docker快速部署ELK环境”文章能帮助大家解决问题...
    99+
    2024-04-02
  • Centos环境 使用docker 部署MySQL 8.X详细版本
    文章目录 安装docker配置docker 阿里镜像加速阿里云容器镜像服务ACR配置镜像源 安装部署MySQL拉取MySQL镜像创建挂载文件测试部署部署MySQL进入容器将它的mysql配...
    99+
    2023-09-04
    docker centos mysql
  • 怎么用Docker快速部署GPU环境
    这篇文章主要为大家展示了“怎么用Docker快速部署GPU环境”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“怎么用Docker快速部署GPU环境”这篇文章吧。在 Linux 服务器上使用 GPU...
    99+
    2023-06-15
  • 如何进行centos卸载系统与环境部署
    这篇文章将为大家详细讲解有关如何进行centos卸载系统与环境部署,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。centos卸载系统已被广泛应用但是也在不断的更新。centos安装好之后ce...
    99+
    2023-06-16
  • 怎么使用docker在linux环境中部署springboot包
    小编给大家分享一下怎么使用docker在linux环境中部署springboot包,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!因为springboot是内嵌了t...
    99+
    2023-06-14
  • docker怎么部署php开发环境
    要部署PHP开发环境,可以使用Docker来创建一个容器化的PHP开发环境。以下是一些步骤: 安装Docker:首先,你需要在你...
    99+
    2023-10-23
    docker php
  • CentOS下怎么部署java开发环境
    本篇内容主要讲解“CentOS下怎么部署java开发环境”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“CentOS下怎么部署java开发环境”吧!硬件JDK1.8.0_121(截止2017-1-...
    99+
    2023-06-27
  • 如何在CentOS 6.3系统中部署一个CHEF环境
    今天就跟大家聊聊有关如何在CentOS 6.3系统中部署一个CHEF环境,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。安装前的准备:(chef.example.com,node1.e...
    99+
    2023-06-10
  • 怎么使用Docker搭建Django,Nginx,R,Python部署环境
    这篇文章将为大家详细讲解有关怎么使用Docker搭建Django,Nginx,R,Python部署环境,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。基本环境:Ubuntu 16.10docker 17.0...
    99+
    2023-06-07
  • 如何将Teprunner测试平台部署到Linux系统Docker
    如何将Teprunner测试平台部署到Linux系统Docker,相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。本地运行通过在Vue项目执行npm run serve和在Djan...
    99+
    2023-06-15
  • centos环境下使用tomcat 部署SpringBoot的war包
    准备war包 一、准备好已有的SpringBoot工程,在pom中添加依赖 1)设置打包格式为war <packaging>war</packaging>...
    99+
    2024-04-02
  • Docker中怎么部署LNMP服务器环境
    今天小编给大家分享一下Docker中怎么部署LNMP服务器环境的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。镜像下载[roo...
    99+
    2023-06-28
  • 如何利用GitLab进行多环境部署和测试
    如何利用GitLab进行多环境部署和测试引言:随着软件开发的迅猛发展,项目中常常会涉及到多个环境的部署和测试。为了简化部署流程和提高交付效率,利用GitLab进行多环境部署和测试成为了一种常见的做法。本文将介绍如何在GitLab中配置和管理...
    99+
    2023-10-25
    GitLab:版本控制 多环境部署:环境管理 测试:自动化测试
  • profiles.active多环境开发、测试、部署过程是什么
    这篇文章主要介绍“profiles.active多环境开发、测试、部署过程是什么”,在日常操作中,相信很多人在profiles.active多环境开发、测试、部署过程是什么问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对...
    99+
    2023-07-05
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作