参考文章:
https://blog.csdn.net/qq_29479041/article/details/82659218
步骤:
1.安装docker
参考文章:
https://blog.csdn.net/qq_29479041/article/details/82659218
https://blog.csdn.net/qq_38345468/article/details/110128659
2.配置docker的镜像源
我是手动修改 /etc/docker/daemon.json文件,然后执行下面命令重启docker
systemctl daemon-reload
systemctl restart docker.service
systemctl status docker -l
3.因为提示前端无法访问,关了linux的防火墙
4.后来后端部署后一直启动不了,又安装了 。NET环境,后端部署由独立部署改为了框架依赖
https://www.cnblogs.com/Mamba8-24/p/16300975.html
5完成了
1、检查内核版本,必须是3.10及以上
uname -r
2、安装docker
yum install docker
3、输入y确认安装
4、启动docker
[root@localhost ~]# systemctl start docker
[root@localhost ~]# docker -v
Docker version 1.12.6, build 3e8e77d/1.12.6
5、开机启动docker
[root@localhost ~]# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
6、停止docker
systemctl stop docker
7、重启docker服务
service docker restart
uname -r
yum install docker
输入y确认安装
systemctl start docker
docker -v
systemctl enable docker
systemctl stop docker
service docker restart
Xshell 5 (Build 0964)
Copyright © 2002-2016 NetSarang Computer, Inc. All rights reserved.
Type `help’ to learn how to use Xshell prompt.
[c:~]$
Connecting to 192.168.1.123:22…
Connection established.
To escape to local shell, press ‘Ctrl+Alt+]’.
Last login: Tue Sep 5 08:49:45 2023 from 192.168.1.222
[root@localhost ~]# docker ps -a
bash: docker: command not found…
[root@localhost ~]#
[root@localhost ~]# uname -r
3.10.0-1160.el7.x86_64
[root@localhost ~]#
[root@localhost ~]# yum install docker
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
Dependencies Resolved
Installing:
docker x86_64 2:1.13.1-209.git7d71120.el7.centos extras 17 M
Installing for dependencies:
atomic-registries x86_64 1:1.22.1-33.gitb507039.el7_8 extras 36 k
container-selinux noarch 2:2.119.2-1.911c772.el7_8 extras 40 k
container-storage-setup noarch 0.11.0-2.git5eaf76c.el7 extras 35 k
containers-common x86_64 1:0.1.40-11.el7_8 extras 43 k
docker-client x86_64 2:1.13.1-209.git7d71120.el7.centos extras 3.9 M
docker-common x86_64 2:1.13.1-209.git7d71120.el7.centos extras 101 k
fuse-overlayfs x86_64 0.7.2-6.el7_8 extras 54 k
fuse3-libs x86_64 3.6.1-4.el7 extras 82 k
oci-register-machine x86_64 1:0-6.git2b44233.el7 extras 1.1 M
oci-systemd-hook x86_64 1:0.2.0-1.git05e6923.el7_6 extras 34 k
oci-umount x86_64 2:2.5-3.el7 extras 33 k
python-dateutil noarch 1.5-7.el7 base 85 k
python-dmidecode x86_64 3.12.2-4.el7 base 83 k
python-pytoml noarch 0.1.14-1.git7dea353.el7 extras 18 k
python-syspurpose x86_64 1.24.52-2.el7.centos updates 277 k
slirp4netns x86_64 0.4.3-4.el7_8 extras 81 k
subscription-manager x86_64 1.24.52-2.el7.centos updates 1.1 M
subscription-manager-rhsm x86_64 1.24.52-2.el7.centos updates 336 k
subscription-manager-rhsm-certificates x86_64 1.24.52-2.el7.centos updates 239 k
Install 1 Package (+19 Dependent packages)
Total 11 MB/s | 25 MB 00:00:02
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
Userid : “CentOS-7 Key (CentOS 7 Official Signing Key) [email protected]”
Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
Package : centos-release-7-9.2009.0.el7.centos.x86_64 (@anaconda)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : python-dateutil-1.5-7.el7.noarch 1/20
Installing : subscription-manager-rhsm-certificates-1.24.52-2.el7.centos.x86_64 2/20
Installing : subscription-manager-rhsm-1.24.52-2.el7.centos.x86_64 3/20
Installing : python-dmidecode-3.12.2-4.el7.x86_64 4/20
Installing : python-pytoml-0.1.14-1.git7dea353.el7.noarch 5/20
Installing : 1:atomic-registries-1.22.1-33.gitb507039.el7_8.x86_64 6/20
Installing : slirp4netns-0.4.3-4.el7_8.x86_64 7/20
Installing : container-storage-setup-0.11.0-2.git5eaf76c.el7.noarch 8/20
Installing : 2:oci-umount-2.5-3.el7.x86_64 9/20
Installing : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch 10/20
Installing : 1:oci-register-machine-0-6.git2b44233.el7.x86_64 11/20
Installing : 1:oci-systemd-hook-0.2.0-1.git05e6923.el7_6.x86_64 12/20
Installing : fuse3-libs-3.6.1-4.el7.x86_64 13/20
Installing : fuse-overlayfs-0.7.2-6.el7_8.x86_64 14/20
Installing : python-syspurpose-1.24.52-2.el7.centos.x86_64 15/20
Installing : subscription-manager-1.24.52-2.el7.centos.x86_64 16/20
Installing : 1:containers-common-0.1.40-11.el7_8.x86_64 17/20
Installing : 2:docker-common-1.13.1-209.git7d71120.el7.centos.x86_64 18/20
Installing : 2:docker-client-1.13.1-209.git7d71120.el7.centos.x86_64 19/20
Installing : 2:docker-1.13.1-209.git7d71120.el7.centos.x86_64 20/20
Verifying : python-syspurpose-1.24.52-2.el7.centos.x86_64 1/20
Verifying : subscription-manager-rhsm-certificates-1.24.52-2.el7.centos.x86_64 2/20
Verifying : fuse3-libs-3.6.1-4.el7.x86_64 3/20
Verifying : subscription-manager-1.24.52-2.el7.centos.x86_64 4/20
Verifying : 1:atomic-registries-1.22.1-33.gitb507039.el7_8.x86_64 5/20
Verifying : python-dateutil-1.5-7.el7.noarch 6/20
Verifying : 2:docker-common-1.13.1-209.git7d71120.el7.centos.x86_64 7/20
Verifying : 1:oci-systemd-hook-0.2.0-1.git05e6923.el7_6.x86_64 8/20
Verifying : subscription-manager-rhsm-1.24.52-2.el7.centos.x86_64 9/20
Verifying : 1:oci-register-machine-0-6.git2b44233.el7.x86_64 10/20
Verifying : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch 11/20
Verifying : 2:oci-umount-2.5-3.el7.x86_64 12/20
Verifying : container-storage-setup-0.11.0-2.git5eaf76c.el7.noarch 13/20
Verifying : 2:docker-client-1.13.1-209.git7d71120.el7.centos.x86_64 14/20
Verifying : slirp4netns-0.4.3-4.el7_8.x86_64 15/20
Verifying : python-pytoml-0.1.14-1.git7dea353.el7.noarch 16/20
Verifying : 1:containers-common-0.1.40-11.el7_8.x86_64 17/20
Verifying : 2:docker-1.13.1-209.git7d71120.el7.centos.x86_64 18/20
Verifying : fuse-overlayfs-0.7.2-6.el7_8.x86_64 19/20
Verifying : python-dmidecode-3.12.2-4.el7.x86_64 20/20
Installed:
docker.x86_64 2:1.13.1-209.git7d71120.el7.centos
Dependency Installed:
atomic-registries.x86_64 1:1.22.1-33.gitb507039.el7_8 container-selinux.noarch 2:2.119.2-1.911c772.el7_8
container-storage-setup.noarch 0:0.11.0-2.git5eaf76c.el7 containers-common.x86_64 1:0.1.40-11.el7_8
docker-client.x86_64 2:1.13.1-209.git7d71120.el7.centos docker-common.x86_64 2:1.13.1-209.git7d71120.el7.centos
fuse-overlayfs.x86_64 0:0.7.2-6.el7_8 fuse3-libs.x86_64 0:3.6.1-4.el7
oci-register-machine.x86_64 1:0-6.git2b44233.el7 oci-systemd-hook.x86_64 1:0.2.0-1.git05e6923.el7_6
oci-umount.x86_64 2:2.5-3.el7 python-dateutil.noarch 0:1.5-7.el7
python-dmidecode.x86_64 0:3.12.2-4.el7 python-pytoml.noarch 0:0.1.14-1.git7dea353.el7
python-syspurpose.x86_64 0:1.24.52-2.el7.centos slirp4netns.x86_64 0:0.4.3-4.el7_8
subscription-manager.x86_64 0:1.24.52-2.el7.centos subscription-manager-rhsm.x86_64 0:1.24.52-2.el7.centos
subscription-manager-rhsm-certificates.x86_64 0:1.24.52-2.el7.centos
Complete!
[root@localhost ~]# systemctl start docker
[root@localhost ~]# docker -v
Docker version 1.13.1, build 7d71120/1.13.1
[root@localhost ~]# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@localhost ~]#
[root@localhost ~]# systemctl stop docker
[root@localhost ~]#
[root@localhost ~]# service docker restart
Redirecting to /bin/systemctl restart docker.service
[root@localhost ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
[root@localhost ~]# systemctl start docker
[root@localhost ~]# docker -v
Docker version 1.13.1, build 7d71120/1.13.1
[root@localhost ~]# systemctl enable docker
[root@localhost ~]# systemctl stop docker
[root@localhost ~]# service docker restart
Redirecting to /bin/systemctl restart docker.service
[root@localhost ~]# cd /www/EmenMonitoring/Emen-Monitoring-back-new
[root@localhost Emen-Monitoring-back-new]#
[root@localhost Emen-Monitoring-back-new]#
[root@localhost Emen-Monitoring-back-new]# docker build -t emen-monitoring-back-new:1.0 .
Sending build context to Docker daemon 199.9 MB
Step 1/10 : FROM mcr.microsoft.com/dotnet/aspnet:6.0
Trying to pull repository mcr.microsoft.com/dotnet/aspnet …
6.0: Pulling from mcr.microsoft.com/dotnet/aspnet
14726c8f7834: Pull complete
6c3981608c2b: Pull complete
a65621c96b07: Pull complete
5a9070a06ae0: Pull complete
d757ae0f0e6a: Pull complete
Digest: sha256:e855110445f4a1b48bb0d5b6de9f14cd2dd311b1daaf047bf0f3965cab3e4a25
Status: Downloaded newer image for mcr.microsoft.com/dotnet/aspnet:6.0
—> 036528001cbb
Step 2/10 : WORKDIR /app
—> ddc74cca2fba
Removing intermediate container 06841cd65cdf
Step 3/10 : EXPOSE 80
—> Running in 4f1873bc46a3
—> 538f746fe491
Removing intermediate container 4f1873bc46a3
Step 4/10 : RUN apt-get update -y
—> Running in 2f785523f4cf
Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
Get:2 http://deb.debian.org/debian-security bullseye-security InRelease [48.4 kB]
Get:3 http://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]
Get:4 http://deb.debian.org/debian bullseye/main amd64 Packages [8183 kB]
Get:5 http://deb.debian.org/debian-security bullseye-security/main amd64 Packages [245 kB]
Get:6 http://deb.debian.org/debian bullseye-updates/main amd64 Packages [17.5 kB]
Fetched 8654 kB in 37s (232 kB/s)
Reading package lists…
—> b12e4180f2b3
Removing intermediate container 2f785523f4cf
Step 5/10 : RUN apt-get install -y libgdiplus
—> Running in 5b1174f3b894
Reading package lists…
Building dependency tree…
Reading state information…
The following additional packages will be installed:
fontconfig-config fonts-dejavu-core libbrotli1 libbsd0 libcairo2 libdeflate0
libexif12 libexpat1 libfontconfig1 libfreetype6 libgif7 libglib2.0-0
libglib2.0-data libjbig0 libjpeg62-turbo libmd0 libpixman-1-0 libpng16-16
libtiff5 libwebp6 libx11-6 libx11-data libxau6 libxcb-render0 libxcb-shm0
libxcb1 libxdmcp6 libxext6 libxml2 libxrender1 sensible-utils
shared-mime-info ucf xdg-user-dirs
The following NEW packages will be installed:
fontconfig-config fonts-dejavu-core libbrotli1 libbsd0 libcairo2 libdeflate0
libexif12 libexpat1 libfontconfig1 libfreetype6 libgdiplus libgif7
libglib2.0-0 libglib2.0-data libjbig0 libjpeg62-turbo libmd0 libpixman-1-0
libpng16-16 libtiff5 libwebp6 libx11-6 libx11-data libxau6 libxcb-render0
libxcb-shm0 libxcb1 libxdmcp6 libxext6 libxml2 libxrender1 sensible-utils
shared-mime-info ucf xdg-user-dirs
0 upgraded, 35 newly installed, 0 to remove and 0 not upgraded.
Need to get 11.2 MB of archives.
After this operation, 39.7 MB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bullseye/main amd64 sensible-utils all 0.0.14 [14.8 kB]
Get:2 http://deb.debian.org/debian bullseye/main amd64 ucf all 3.0043 [74.0 kB]
Get:3 http://deb.debian.org/debian bullseye/main amd64 fonts-dejavu-core all 2.37-2 [1069 kB]
Get:4 http://deb.debian.org/debian bullseye/main amd64 fontconfig-config all 2.13.1-4.2 [281 kB]
Get:5 http://deb.debian.org/debian bullseye/main amd64 libbrotli1 amd64 1.0.9-2+b2 [279 kB]
Get:6 http://deb.debian.org/debian bullseye/main amd64 libmd0 amd64 1.0.3-3 [28.0 kB]
Get:7 http://deb.debian.org/debian bullseye/main amd64 libbsd0 amd64 0.11.3-1 [108 kB]
Get:8 http://deb.debian.org/debian bullseye/main amd64 libexpat1 amd64 2.2.10-2+deb11u5 [98.2 kB]
Get:9 http://deb.debian.org/debian bullseye/main amd64 libpng16-16 amd64 1.6.37-3 [294 kB]
Get:10 http://deb.debian.org/debian bullseye/main amd64 libfreetype6 amd64 2.10.4+dfsg-1+deb11u1 [418 kB]
Get:11 http://deb.debian.org/debian bullseye/main amd64 libfontconfig1 amd64 2.13.1-4.2 [347 kB]
Get:12 http://deb.debian.org/debian bullseye/main amd64 libpixman-1-0 amd64 0.40.0-1.1~deb11u1 [543 kB]
Get:13 http://deb.debian.org/debian bullseye/main amd64 libxau6 amd64 1:1.0.9-1 [19.7 kB]
Get:14 http://deb.debian.org/debian bullseye/main amd64 libxdmcp6 amd64 1:1.1.2-3 [26.3 kB]
Get:15 http://deb.debian.org/debian bullseye/main amd64 libxcb1 amd64 1.14-3 [140 kB]
Get:16 http://deb.debian.org/debian-security bullseye-security/main amd64 libx11-data all 2:1.7.2-1+deb11u1 [311 kB]
Get:17 http://deb.debian.org/debian-security bullseye-security/main amd64 libx11-6 amd64 2:1.7.2-1+deb11u1 [772 kB]
Get:18 http://deb.debian.org/debian bullseye/main amd64 libxcb-render0 amd64 1.14-3 [111 kB]
Get:19 http://deb.debian.org/debian bullseye/main amd64 libxcb-shm0 amd64 1.14-3 [101 kB]
Get:20 http://deb.debian.org/debian bullseye/main amd64 libxext6 amd64 2:1.3.3-1.1 [52.7 kB]
Get:21 http://deb.debian.org/debian bullseye/main amd64 libxrender1 amd64 1:0.9.10-1 [33.0 kB]
Get:22 http://deb.debian.org/debian bullseye/main amd64 libcairo2 amd64 1.16.0-5 [694 kB]
Get:23 http://deb.debian.org/debian bullseye/main amd64 libdeflate0 amd64 1.7-1 [53.1 kB]
Get:24 http://deb.debian.org/debian bullseye/main amd64 libexif12 amd64 0.6.22-3 [376 kB]
Get:25 http://deb.debian.org/debian bullseye/main amd64 libgif7 amd64 5.1.9-2 [45.1 kB]
Get:26 http://deb.debian.org/debian bullseye/main amd64 libglib2.0-0 amd64 2.66.8-1 [1370 kB]
Get:27 http://deb.debian.org/debian bullseye/main amd64 libjpeg62-turbo amd64 1:2.0.6-4 [151 kB]
Get:28 http://deb.debian.org/debian bullseye/main amd64 libjbig0 amd64 2.1-3.1+b2 [31.0 kB]
Get:29 http://deb.debian.org/debian-security bullseye-security/main amd64 libwebp6 amd64 0.6.1-2.1+deb11u1 [258 kB]
Get:30 http://deb.debian.org/debian bullseye/main amd64 libtiff5 amd64 4.2.0-1+deb11u4 [290 kB]
Get:31 http://deb.debian.org/debian bullseye/main amd64 libgdiplus amd64 6.0.4+dfsg-2 [162 kB]
Get:32 http://deb.debian.org/debian bullseye/main amd64 libglib2.0-data all 2.66.8-1 [1164 kB]
Get:33 http://deb.debian.org/debian bullseye/main amd64 libxml2 amd64 2.9.10+dfsg-6.7+deb11u4 [693 kB]
Get:34 http://deb.debian.org/debian bullseye/main amd64 shared-mime-info amd64 2.0-1 [701 kB]
Get:35 http://deb.debian.org/debian bullseye/main amd64 xdg-user-dirs amd64 0.17-2 [53.8 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 11.2 MB in 4s (2594 kB/s)
Selecting previously unselected package sensible-utils.
(Reading database … 6988 files and directories currently installed.)
Preparing to unpack …/00-sensible-utils_0.0.14_all.deb …
Unpacking sensible-utils (0.0.14) …
Selecting previously unselected package ucf.
Preparing to unpack …/01-ucf_3.0043_all.deb …
Moving old data out of the way
Unpacking ucf (3.0043) …
Selecting previously unselected package fonts-dejavu-core.
Preparing to unpack …/02-fonts-dejavu-core_2.37-2_all.deb …
Unpacking fonts-dejavu-core (2.37-2) …
Selecting previously unselected package fontconfig-config.
Preparing to unpack …/03-fontconfig-config_2.13.1-4.2_all.deb …
Unpacking fontconfig-config (2.13.1-4.2) …
Selecting previously unselected package libbrotli1:amd64.
Preparing to unpack …/04-libbrotli1_1.0.9-2+b2_amd64.deb …
Unpacking libbrotli1:amd64 (1.0.9-2+b2) …
Selecting previously unselected package libmd0:amd64.
Preparing to unpack …/05-libmd0_1.0.3-3_amd64.deb …
Unpacking libmd0:amd64 (1.0.3-3) …
Selecting previously unselected package libbsd0:amd64.
Preparing to unpack …/06-libbsd0_0.11.3-1_amd64.deb …
Unpacking libbsd0:amd64 (0.11.3-1) …
Selecting previously unselected package libexpat1:amd64.
Preparing to unpack …/07-libexpat1_2.2.10-2+deb11u5_amd64.deb …
Unpacking libexpat1:amd64 (2.2.10-2+deb11u5) …
Selecting previously unselected package libpng16-16:amd64.
Preparing to unpack …/08-libpng16-16_1.6.37-3_amd64.deb …
Unpacking libpng16-16:amd64 (1.6.37-3) …
Selecting previously unselected package libfreetype6:amd64.
Preparing to unpack …/09-libfreetype6_2.10.4+dfsg-1+deb11u1_amd64.deb …
Unpacking libfreetype6:amd64 (2.10.4+dfsg-1+deb11u1) …
Selecting previously unselected package libfontconfig1:amd64.
Preparing to unpack …/10-libfontconfig1_2.13.1-4.2_amd64.deb …
Unpacking libfontconfig1:amd64 (2.13.1-4.2) …
Selecting previously unselected package libpixman-1-0:amd64.
Preparing to unpack …/11-libpixman-1-0_0.40.0-1.1~deb11u1_amd64.deb …
Unpacking libpixman-1-0:amd64 (0.40.0-1.1~deb11u1) …
Selecting previously unselected package libxau6:amd64.
Preparing to unpack …/12-libxau6_1%3a1.0.9-1_amd64.deb …
Unpacking libxau6:amd64 (1:1.0.9-1) …
Selecting previously unselected package libxdmcp6:amd64.
Preparing to unpack …/13-libxdmcp6_1%3a1.1.2-3_amd64.deb …
Unpacking libxdmcp6:amd64 (1:1.1.2-3) …
Selecting previously unselected package libxcb1:amd64.
Preparing to unpack …/14-libxcb1_1.14-3_amd64.deb …
Unpacking libxcb1:amd64 (1.14-3) …
Selecting previously unselected package libx11-data.
Preparing to unpack …/15-libx11-data_2%3a1.7.2-1+deb11u1_all.deb …
Unpacking libx11-data (2:1.7.2-1+deb11u1) …
Selecting previously unselected package libx11-6:amd64.
Preparing to unpack …/16-libx11-6_2%3a1.7.2-1+deb11u1_amd64.deb …
Unpacking libx11-6:amd64 (2:1.7.2-1+deb11u1) …
Selecting previously unselected package libxcb-render0:amd64.
Preparing to unpack …/17-libxcb-render0_1.14-3_amd64.deb …
Unpacking libxcb-render0:amd64 (1.14-3) …
Selecting previously unselected package libxcb-shm0:amd64.
Preparing to unpack …/18-libxcb-shm0_1.14-3_amd64.deb …
Unpacking libxcb-shm0:amd64 (1.14-3) …
Selecting previously unselected package libxext6:amd64.
Preparing to unpack …/19-libxext6_2%3a1.3.3-1.1_amd64.deb …
Unpacking libxext6:amd64 (2:1.3.3-1.1) …
Selecting previously unselected package libxrender1:amd64.
Preparing to unpack …/20-libxrender1_1%3a0.9.10-1_amd64.deb …
Unpacking libxrender1:amd64 (1:0.9.10-1) …
Selecting previously unselected package libcairo2:amd64.
Preparing to unpack …/21-libcairo2_1.16.0-5_amd64.deb …
Unpacking libcairo2:amd64 (1.16.0-5) …
Selecting previously unselected package libdeflate0:amd64.
Preparing to unpack …/22-libdeflate0_1.7-1_amd64.deb …
Unpacking libdeflate0:amd64 (1.7-1) …
Selecting previously unselected package libexif12:amd64.
Preparing to unpack …/23-libexif12_0.6.22-3_amd64.deb …
Unpacking libexif12:amd64 (0.6.22-3) …
Selecting previously unselected package libgif7:amd64.
Preparing to unpack …/24-libgif7_5.1.9-2_amd64.deb …
Unpacking libgif7:amd64 (5.1.9-2) …
Selecting previously unselected package libglib2.0-0:amd64.
Preparing to unpack …/25-libglib2.0-0_2.66.8-1_amd64.deb …
Unpacking libglib2.0-0:amd64 (2.66.8-1) …
Selecting previously unselected package libjpeg62-turbo:amd64.
Preparing to unpack …/26-libjpeg62-turbo_1%3a2.0.6-4_amd64.deb …
Unpacking libjpeg62-turbo:amd64 (1:2.0.6-4) …
Selecting previously unselected package libjbig0:amd64.
Preparing to unpack …/27-libjbig0_2.1-3.1+b2_amd64.deb …
Unpacking libjbig0:amd64 (2.1-3.1+b2) …
Selecting previously unselected package libwebp6:amd64.
Preparing to unpack …/28-libwebp6_0.6.1-2.1+deb11u1_amd64.deb …
Unpacking libwebp6:amd64 (0.6.1-2.1+deb11u1) …
Selecting previously unselected package libtiff5:amd64.
Preparing to unpack …/29-libtiff5_4.2.0-1+deb11u4_amd64.deb …
Unpacking libtiff5:amd64 (4.2.0-1+deb11u4) …
Selecting previously unselected package libgdiplus.
Preparing to unpack …/30-libgdiplus_6.0.4+dfsg-2_amd64.deb …
Unpacking libgdiplus (6.0.4+dfsg-2) …
Selecting previously unselected package libglib2.0-data.
Preparing to unpack …/31-libglib2.0-data_2.66.8-1_all.deb …
Unpacking libglib2.0-data (2.66.8-1) …
Selecting previously unselected package libxml2:amd64.
Preparing to unpack …/32-libxml2_2.9.10+dfsg-6.7+deb11u4_amd64.deb …
Unpacking libxml2:amd64 (2.9.10+dfsg-6.7+deb11u4) …
Selecting previously unselected package shared-mime-info.
Preparing to unpack …/33-shared-mime-info_2.0-1_amd64.deb …
Unpacking shared-mime-info (2.0-1) …
Selecting previously unselected package xdg-user-dirs.
Preparing to unpack …/34-xdg-user-dirs_0.17-2_amd64.deb …
Unpacking xdg-user-dirs (0.17-2) …
Setting up libexpat1:amd64 (2.2.10-2+deb11u5) …
Setting up libpixman-1-0:amd64 (0.40.0-1.1~deb11u1) …
Setting up libxau6:amd64 (1:1.0.9-1) …
Setting up xdg-user-dirs (0.17-2) …
Setting up libglib2.0-0:amd64 (2.66.8-1) …
No schema files found: doing nothing.
Setting up libbrotli1:amd64 (1.0.9-2+b2) …
Setting up libdeflate0:amd64 (1.7-1) …
Setting up libjbig0:amd64 (2.1-3.1+b2) …
Setting up libglib2.0-data (2.66.8-1) …
Setting up libjpeg62-turbo:amd64 (1:2.0.6-4) …
Setting up libx11-data (2:1.7.2-1+deb11u1) …
Setting up libexif12:amd64 (0.6.22-3) …
Setting up libpng16-16:amd64 (1.6.37-3) …
Setting up libwebp6:amd64 (0.6.1-2.1+deb11u1) …
Setting up fonts-dejavu-core (2.37-2) …
Setting up libgif7:amd64 (5.1.9-2) …
Setting up libmd0:amd64 (1.0.3-3) …
Setting up sensible-utils (0.0.14) …
Setting up libtiff5:amd64 (4.2.0-1+deb11u4) …
Setting up libbsd0:amd64 (0.11.3-1) …
Setting up libxml2:amd64 (2.9.10+dfsg-6.7+deb11u4) …
Setting up libxdmcp6:amd64 (1:1.1.2-3) …
Setting up libxcb1:amd64 (1.14-3) …
Setting up libxcb-render0:amd64 (1.14-3) …
Setting up libxcb-shm0:amd64 (1.14-3) …
Setting up libfreetype6:amd64 (2.10.4+dfsg-1+deb11u1) …
Setting up shared-mime-info (2.0-1) …
Setting up ucf (3.0043) …
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can’t locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.32.1 /usr/local/share/perl/5.32.1 /usr/lib/x86_64-linux-gnu/perl5/5.32 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.32 /usr/share/perl/5.32 /usr/local/lib/site_perl) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Setting up libx11-6:amd64 (2:1.7.2-1+deb11u1) …
Setting up libxrender1:amd64 (1:0.9.10-1) …
Setting up fontconfig-config (2.13.1-4.2) …
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can’t locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.32.1 /usr/local/share/perl/5.32.1 /usr/lib/x86_64-linux-gnu/perl5/5.32 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.32 /usr/share/perl/5.32 /usr/local/lib/site_perl) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Setting up libxext6:amd64 (2:1.3.3-1.1) …
Setting up libfontconfig1:amd64 (2.13.1-4.2) …
Setting up libcairo2:amd64 (1.16.0-5) …
Setting up libgdiplus (6.0.4+dfsg-2) …
Processing triggers for libc-bin (2.31-13+deb11u6) …
—> bf1f020b28e3
Removing intermediate container 5b1174f3b894
Step 6/10 : RUN apt-get clean
—> Running in 90f57a4b7758
—> fcce83b10ed9
Removing intermediate container 90f57a4b7758
Step 7/10 : RUN ln -s /usr/lib/libgdiplus.so /usr/lib/gdiplus.dll
—> Running in fd4001177d6a
—> aeafab3148e5
Removing intermediate container fd4001177d6a
Step 8/10 : EXPOSE 443
—> Running in 902c4d370b20
—> bdac698d8719
Removing intermediate container 902c4d370b20
Step 9/10 : COPY . .
—> 903e2e3995d6
Removing intermediate container 2ea680c80707
Step 10/10 : ENTRYPOINT dotnet Emen.Web.Entry.dll
—> Running in 256780560b3c
—> 8115e1fce03c
Removing intermediate container 256780560b3c
Successfully built 8115e1fce03c
[root@localhost Emen-Monitoring-back-new]# docker run --name emen-monitoring-back-new -p 6611:80 --restart=always -d emen-monitoring-back-new:1.0
9b847c23372b95210d8a0cc53b469367c0383c9722b1fc4c51159aae1132e819
[root@localhost Emen-Monitoring-back-new]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9b847c23372b emen-monitoring-back-new:1.0 “dotnet Emen.Web.E…” 9 seconds ago Up 7 seconds 443/tcp, 0.0.0.0:6611->80/tcp emen-monitoring-back-new
[root@localhost Emen-Monitoring-back-new]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9b847c23372b emen-monitoring-back-new:1.0 “dotnet Emen.Web.E…” 13 seconds ago Up 1 second 443/tcp, 0.0.0.0:6611->80/tcp emen-monitoring-back-new
[root@localhost Emen-Monitoring-back-new]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9b847c23372b emen-monitoring-back-new:1.0 “dotnet Emen.Web.E…” 59 seconds ago Up 1 second 443/tcp, 0.0.0.0:6611->80/tcp emen-monitoring-back-new
[root@localhost Emen-Monitoring-back-new]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9b847c23372b emen-monitoring-back-new:1.0 “dotnet Emen.Web.E…” 2 minutes ago Up 6 seconds 443/tcp, 0.0.0.0:6611->80/tcp emen-monitoring-back-new
[root@localhost Emen-Monitoring-back-new]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9b847c23372b emen-monitoring-back-new:1.0 “dotnet Emen.Web.E…” 2 minutes ago Up 8 seconds 443/tcp, 0.0.0.0:6611->80/tcp emen-monitoring-back-new
[root@localhost Emen-Monitoring-back-new]# http://192.168.1.123:6611/
-bash: http://192.168.1.123:6611/: No such file or directory
[root@localhost Emen-Monitoring-back-new]# systemctl stop firewalld
[root@localhost Emen-Monitoring-back-new]# /www/EmenMonitoring/Emen-Monitoring-front
-bash: /www/EmenMonitoring/Emen-Monitoring-front: Is a directory
[root@localhost Emen-Monitoring-back-new]#
[root@localhost Emen-Monitoring-back-new]#
[root@localhost Emen-Monitoring-back-new]# docker build -t emen-monitoring-front:1.0 .
Sending build context to Docker daemon 199.9 MB
Step 1/10 : FROM mcr.microsoft.com/dotnet/aspnet:6.0
—> 036528001cbb
Step 2/10 : WORKDIR /app
—> Using cache
—> ddc74cca2fba
Step 3/10 : EXPOSE 80
—> Using cache
—> 538f746fe491
Step 4/10 : RUN apt-get update -y
—> Using cache
—> b12e4180f2b3
Step 5/10 : RUN apt-get install -y libgdiplus
—> Using cache
—> bf1f020b28e3
Step 6/10 : RUN apt-get clean
—> Using cache
—> fcce83b10ed9
Step 7/10 : RUN ln -s /usr/lib/libgdiplus.so /usr/lib/gdiplus.dll
—> Using cache
—> aeafab3148e5
Step 8/10 : EXPOSE 443
—> Using cache
—> bdac698d8719
Step 9/10 : COPY . .
—> Using cache
—> 903e2e3995d6
Step 10/10 : ENTRYPOINT dotnet Emen.Web.Entry.dll
—> Using cache
—> 8115e1fce03c
Successfully built 8115e1fce03c
[root@localhost Emen-Monitoring-back-new]# docker run --name emen-monitoring-front -p 8687:80 --restart=always -d emen-monitoring-front:1.0
8ae36fa1f3e57807bc43a8845e31c1052a2cbb6228209144b7383ad060d9732a
/usr/bin/docker-current: Error response from daemon: driver failed programming external connectivity on endpoint emen-monitoring-front (5755016d7b9d6fadc6f0beb44a0ee8612ae8f3aef9b2e7c0ca04c2d43ef2b5c5): (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 8687 -j DNAT --to-destination 172.17.0.2:80 ! -i docker0: iptables: No chain/target/match by that name.
(exit status 1)).
[root@localhost Emen-Monitoring-back-new]# cd /root
[root@localhost ~]#
[root@localhost ~]# docker stop emen-monitoring-front
emen-monitoring-front
[root@localhost ~]# docker rm emen-monitoring-front
emen-monitoring-front
[root@localhost ~]# docker rmi emen-monitoring-front:1.0
Untagged: emen-monitoring-front:1.0
[root@localhost ~]# /www/EmenMonitoring/Emen-Monitoring-front
-bash: /www/EmenMonitoring/Emen-Monitoring-front: Is a directory
[root@localhost ~]# cd /www/EmenMonitoring/Emen-Monitoring-front
[root@localhost Emen-Monitoring-front]#
[root@localhost Emen-Monitoring-front]# docker build -t emen-monitoring-front:1.0 .
Sending build context to Docker daemon 159.7 MB
Step 1/5 : FROM nginx:alpine
Trying to pull repository docker.io/library/nginx …
alpine: Pulling from docker.io/library/nginx
7264a8db6415: Pulling fs layer
518c62654cf0: Downloading [=> ] 38.89 kB/1.898 MB
d8c801465ddf: Download complete
ac28ec6b1e86: Download complete
eb8fb38efa48: Download complete
e92e38a9a0eb: Download complete
58663ac43ae7: Download complete
2f545e207252: Waiting
error pulling image configuration: read tcp 192.168.1.123:45570->104.16.104.207:443: read: connection reset by peer
[root@localhost Emen-Monitoring-front]# docker run --name emen-monitoring-front -p 8687:80 --restart=always -d emen-monitoring-front:1.0
Unable to find image ‘emen-monitoring-front:1.0’ locally
Trying to pull repository docker.io/library/emen-monitoring-front …
/usr/bin/docker-current: repository docker.io/emen-monitoring-front not found: does not exist or no pull access.
See ‘/usr/bin/docker-current run --help’.
[root@localhost Emen-Monitoring-front]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9b847c23372b emen-monitoring-back-new:1.0 “dotnet Emen.Web.E…” 10 minutes ago Restarting (139) 8 minutes ago emen-monitoring-back-new
[root@localhost Emen-Monitoring-front]# docker build -t emen-monitoring-front:1.0 .
Sending build context to Docker daemon 159.7 MB
Step 1/5 : FROM nginx:alpine
Trying to pull repository docker.io/library/nginx …
alpine: Pulling from docker.io/library/nginx
7264a8db6415: Downloading [> ] 34.79 kB/3.402 MB
518c62654cf0: Pulling fs layer
d8c801465ddf: Retrying in 1 second
ac28ec6b1e86: Waiting
eb8fb38efa48: Waiting
e92e38a9a0eb: Waiting
58663ac43ae7: Waiting
2f545e207252: Waiting
error pulling image configuration: read tcp 192.168.1.123:34586->104.16.101.207:443: read: connection reset by peer
[root@localhost Emen-Monitoring-front]# docker run --name emen-monitoring-front -p 8687:80 --restart=always -d emen-monitoring-front:1.0
Unable to find image ‘emen-monitoring-front:1.0’ locally
Trying to pull repository docker.io/library/emen-monitoring-front …
/usr/bin/docker-current: repository docker.io/emen-monitoring-front not found: does not exist or no pull access.
See ‘/usr/bin/docker-current run --help’.
[root@localhost Emen-Monitoring-front]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
emen-monitoring-back-new 1.0 8115e1fce03c 14 minutes ago 452 MB
mcr.microsoft.com/dotnet/aspnet 6.0 036528001cbb 2 weeks ago 208 MB
[root@localhost Emen-Monitoring-front]# docker build -t emen-monitoring-front:1.0 .
Sending build context to Docker daemon 159.7 MB
Step 1/5 : FROM nginx:alpine
Trying to pull repository docker.io/library/nginx …
alpine: Pulling from docker.io/library/nginx
7264a8db6415: Pulling fs layer
518c62654cf0: Retrying in 1 second
d8c801465ddf: Download complete
ac28ec6b1e86: Download complete
eb8fb38efa48: Download complete
e92e38a9a0eb: Download complete
58663ac43ae7: Download complete
2f545e207252: Waiting
error pulling image configuration: read tcp 192.168.1.123:43796->104.16.100.207:443: read: connection timed out
[root@localhost Emen-Monitoring-front]# ^C
[root@localhost Emen-Monitoring-front]# ^C
[root@localhost Emen-Monitoring-front]# ^C
[root@localhost Emen-Monitoring-front]# cd /www/EmenMonitoring/Emen-Monitoring-front
[root@localhost Emen-Monitoring-front]#
[root@localhost Emen-Monitoring-front]#
[root@localhost Emen-Monitoring-front]# docker build -t emen-monitoring-front:1.0 .
Sending build context to Docker daemon 159.7 MB
Step 1/5 : FROM nginx:alpine
Trying to pull repository docker.io/library/nginx …
alpine: Pulling from docker.io/library/nginx
7264a8db6415: Pulling fs layer
518c62654cf0: Pulling fs layer
d8c801465ddf: Pulling fs layer
ac28ec6b1e86: Waiting
eb8fb38efa48: Waiting
e92e38a9a0eb: Waiting
58663ac43ae7: Waiting
2f545e207252: Waiting
^C
[root@localhost Emen-Monitoring-front]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
emen-monitoring-back-new 1.0 8115e1fce03c 34 minutes ago 452 MB
mcr.microsoft.com/dotnet/aspnet 6.0 036528001cbb 2 weeks ago 208 MB
[root@localhost Emen-Monitoring-front]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9b847c23372b emen-monitoring-back-new:1.0 “dotnet Emen.Web.E…” 34 minutes ago Restarting (139) 32 minutes ago emen-monitoring-back-new
[root@localhost Emen-Monitoring-front]# cd /www/EmenMonitoring/Emen-Monitoring-front
[root@localhost Emen-Monitoring-front]#
[root@localhost Emen-Monitoring-front]#
[root@localhost Emen-Monitoring-front]# docker build -t emen-monitoring-front:1.0 .
Sending build context to Docker daemon 159.7 MB
Step 1/5 : FROM nginx:alpine
Trying to pull repository docker.io/library/nginx …
alpine: Pulling from docker.io/library/nginx
7264a8db6415: Retrying in 1 second
518c62654cf0: Pulling fs layer
d8c801465ddf: Waiting
ac28ec6b1e86: Waiting
eb8fb38efa48: Waiting
e92e38a9a0eb: Waiting
58663ac43ae7: Waiting
2f545e207252: Waiting
error pulling image configuration: Get https://production.cloudflare.docker.com/registry-v2/docker/registry/v2/blobs/sha256/43/433dbc17191a7830a9db6454bcc23414ad36caecedab39d1e51d41083ab1d629/data?verify=1693898817-taUpaE9nL437O5sz3ylv4s70yMw%3D: net/http: TLS handshake timeout
[root@localhost Emen-Monitoring-front]# docker run --name emen-monitoring-front -p 8687:80 --restart=always -d emen-monitoring-front:1.0
Unable to find image ‘emen-monitoring-front:1.0’ locally
Trying to pull repository docker.io/library/emen-monitoring-front …
/usr/bin/docker-current: repository docker.io/emen-monitoring-front not found: does not exist or no pull access.
See ‘/usr/bin/docker-current run --help’.
[root@localhost Emen-Monitoring-front]#
[root@localhost ~]# sudo mkdir -p /etc/docker
[root@localhost ~]# sudo tee /etc/docker/daemon.json <<-‘EOF’
{
“registry-mirrors”: [“http://hub-mirror.c.163.com”]
}
EOF
{
“registry-mirrors”: [“http://hub-mirror.c.163.com”]
}
[root@localhost ~]# sudo systemctl daemon-reload
[root@localhost ~]# sudo systemctl restart docker
[root@localhost ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c40b24dc4bf5 hello-world “/hello” About a minute ago Exited (0) About a minute ago unruffled_jennings
[root@localhost ~]# cd /www/EmenMonitoring/Emen-Monitoring-back-new
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-‘EOF’
{
“registry-mirrors”: [“https://docker.mirrors.ustc.edu.cn”]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
1.镜像拉取报错Get
error pulling image configuration: Get https://production.cloudflare.docker.com/registry-v2/docker/registry/v2/blobs/sha256/43/433dbc17191a7830a9db6454bcc23414ad36caecedab39d1e51d41083ab1d629/data?verify=1693898817-taUpaE9nL437O5sz3ylv4s70yMw%3D: net/http: TLS handshake timeout
https://blog.csdn.net/SHELLCODE_8BIT/article/details/126948680
docker配置多个镜像仓库
https://blog.csdn.net/m0_51632271/article/details/126507487
2.报错信息
error pulling image configuration: read tcp 192.168.0.103:58928->104.18.123.25:443: read: connection reset by peer
这两个报错信息都是因为 镜像源不好用导致的,更好一下镜像源试试。
我部署了123/124/125 3个服务器,同一个镜像源 124就好用,123/125就不能用,换了其他镜像源就正常了。
124:
{
“registry-mirrors”: [“https://docker.mirrors.ustc.edu.cn”]
}
123:
{
“registry-mirrors”: [“http://hub-mirror.c.163.com”]
}
二、对于centos7系统
centos7使用firewall命令来开启和关闭防火墙。
1.systemctl命令
(1)systemctl status firewalld.service查看防火墙的状态;
(2)systemctl start firewalld.service启动防火墙;
(3)systemctl stop firewalld.service关闭防火墙;
(4)systemctl restart firewalld.service重启防火墙;
(5)systemctl enable firewalld.service开机启动防火墙;
(6)systemctl disable firewalld.service开机禁用防火墙;
(7)systemctl is-enabled firewalld.service查看防火墙是否开机启动;
————————————————
版权声明:本文为CSDN博主「istrangeboy」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/istrangeboy/article/details/112747366
systemctl daemon-reload
systemctl restart docker.service
systemctl status docker -l