docker镜像nginx1.26.0版本,与删除docker容器【灵异事件】

2024-05-11 09:04

本文主要是介绍docker镜像nginx1.26.0版本,与删除docker容器【灵异事件】,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

为了http3 的这个模块,所以需要升级nginx的版本,需要nginx1.26.0才有
–with-http_v3_module 这个模块

为什么记录一下?因为觉得奇怪

1:删除nginx镜像,显示镜像还被某个容器在使用

luichun@luichun:~$ docker rmi nginx:latest
Error response from daemon: conflict: unable to remove repository reference "nginx:latest" (must force) - container 05bfcd451e31 is using its referenced image 03861782bd3b

2:通过docker ps 命令查看当前运行的docker容器
结果:显示当前是没有容器在运行

luichun@luichun:~$ docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

解决方法

在这里插入图片描述

1:停止容器

luichun@luichun:~$ docker stop 05bfcd451e31
05bfcd451e31

2:删除容器–二次删除容器

luichun@luichun:~$ docker rm 05bfcd451e31
05bfcd451e31
luichun@luichun:~$ docker rm 05bfcd451e31
Error response from daemon: No such container: 05bfcd451e31

3:删除nginx镜像

luichun@luichun:~$ docker rmi nginx:latest
Untagged: nginx:latest
Untagged: nginx@sha256:d1c3a4e634ab6b7089dfc0b1e70a401972493e9e16a65b3f655b3a07955571f7
Deleted: sha256:03861782bd3bd54ac209eb40764e3851600bc7c59b2782fc65da7ff629bd8b54
Deleted: sha256:bc2568706140a3fddba85f62a5b19f849340d0e45307fd4e1402e30b40889dc3
Deleted: sha256:ca6863b2a3d7623a6c5b33036ff7b42e4286723d242be0750b5f14d4370c3044
Deleted: sha256:fb39d1ca636d8b05990a26268246641b60283e26a2432e087eec8bae545233dc
Deleted: sha256:708c786290e909197e36af6f57687b7edf3f7f9e17f13a4095f48b13c1baa148
Deleted: sha256:5e238c87da4f01c383b5aeac4c4b23e18857577d45d0ba4f6b83746e522b6fdc
Deleted: sha256:7ddff5277be31f8e292d130b498e1a8dec264f3963f99d46ced3ea7bc7338557

重新下载最新的nginx镜像【nginx:latest是1.25.5】

docker run -d -P nginx:latest

查看nginx镜像

luichun@luichun:~$ docker images
REPOSITORY                        TAG         IMAGE ID       CREATED         SIZE
nginx                             latest      1d668e06f1e5   6 days ago      188MB

在这里插入图片描述

查看这个镜像的历史信息

1 查看这个镜像做过些什么

luichun@luichun:~$ docker history nginx:latest
IMAGE          CREATED       CREATED BY                              
03861782bd3b   2 weeks ago   CMD ["nginx" "-g" "daemon off;"]                容器启动时要执行的命令为 nginx -g daemon off;
<missing>      2 weeks ago   STOPSIGNAL SIGQUIT                              使用STOPSIGNAL指令设置了容器的停止信号为SIGQUIT
<missing>      2 weeks ago   EXPOSE map[80/tcp:{}]                           使用EXPOSE指令暴露了容器的80端口
<missing>      2 weeks ago   ENTRYPOINT ["/docker-entrypoint.sh"]            使用ENTRYPOINT指令设置了容器的入口点为/docker-entrypoint.sh
<missing>      2 weeks ago   COPY 30-tune-worker-processes.sh /docker-ent…   复制了30-tune-worker-processes.sh文件    到/docker-entrypoint.d/目录中,
<missing>      2 weeks ago   COPY 20-envsubst-on-templates.sh /docker-ent…   复制了20-envsubst-on-templates.sh文件    到/docker-entrypoint.d/目录中,
<missing>      2 weeks ago   COPY 15-local-resolvers.envsh /docker-entryp…   复制了15-local-resolvers.envsh文件       到/docker-entrypoint.d/目录中,
<missing>      2 weeks ago   COPY 10-listen-on-ipv6-by-default.sh /docker…   复制了10-listen-on-ipv6-by-default.sh文件到/docker-entrypoint.d/目录中,
<missing>      2 weeks ago   COPY docker-entrypoint.sh / # buildkit          复制了docker-entrypoint.sh 文件到/ 目录中,根目录
<missing>      2 weeks ago   RUN /bin/sh -c set -x     && groupadd --syst…   执行了一系列命令,包括创建系统用户组等操作
<missing>      2 weeks ago   ENV PKG_RELEASE=1~bookworm                      设置了环境变量PKG_RELEASE为1~bookworm
<missing>      2 weeks ago   ENV NJS_RELEASE=2~bookworm                      设置了环境变量NJS_RELEASE为2~bookworm
<missing>      2 weeks ago   ENV NJS_VERSION=0.8.4                           设置了环境变量NJS_VERSION=0.8.4    
<missing>      2 weeks ago   ENV NGINX_VERSION=1.25.5                        设置了环境变量NGINX_VERSION=1.25.5       
<missing>      2 weeks ago   LABEL maintainer=NGINX Docker Maintainers <d…   添加了标签
<missing>      4 weeks ago   /bin/sh -c #(nop)  CMD ["bash"]                 使用CMD指令设置了容器启动时要执行的命令为bash
<missing>      4 weeks ago   /bin/sh -c #(nop) ADD file:d4bb05cb4d403a78b…   添加了一个文件,但未给出文件名和具体内容。
luichun@luichun:~$

这并不是我想要的nginx的版本,我希望nginx的版本是1.26.0这个版本

通过docker hub 查看nginx

在这里插入图片描述

所以我重新删除了这个nginx

luichun@luichun:~$ docker rmi nginx:latest
Error response from daemon: conflict: unable to remove repository reference "nginx:latest" (must force) - container 3a49c535a7bf is using its referenced image 1d668e06f1e5
luichun@luichun:~$ docker stop 3a49c535a7bf
3a49c535a7bf
luichun@luichun:~$ docker rm 3a49c535a7bf
3a49c535a7bf
luichun@luichun:~$ docker rmi nginx:latest
Untagged: nginx:latest
Untagged: nginx@sha256:32e76d4f34f80e479964a0fbd4c5b4f6967b5322c8d004e9cf0cb81c93510766
Deleted: sha256:1d668e06f1e534ab338404ba891c37d618dd53c9073dcdd4ebde82aa7643f83f
Deleted: sha256:682c535e9134a5a3ed2363f4f3157b1775d6909ba09821c89834487cdc987145
Deleted: sha256:8d4ac15aab86b75e75a1f3b4f6606872df9435cd84245e5084a287c3b678f4fc
Deleted: sha256:97747011f58480c1b05123187af96370ee38c15c57a98f0b8da53fcf2042e222
Deleted: sha256:503533d0672e01e9deeff1aaab9495f54783ae70a4036a77ed715208d62f8a50
Deleted: sha256:60f69ec2ab71ac63bcc19f116118e03118eabd578128d2fa75fdd6a476459ed7
Deleted: sha256:e995270c3fe3253ceaa35882876089c2ef357c502ce8f1f7e683946d1fdf6f62
Deleted: sha256:52ec5a4316fadc09a4a51f82b8d7b66ead0d71bea4f75e81e25b4094c4219061

下载nginx1.26.0版本的nginx

docker pull nginx:stable-perl
luichun@luichun:~$ docker pull nginx:stable-perl
stable-perl: Pulling from library/nginx
b0a0cf830b12: Pull complete
13af041419fe: Pull complete
73a2f02e459b: Pull complete
325ea416f2bb: Pull complete
98760cd21ba6: Pull complete
77702ab39408: Pull complete
d095688b3926: Pull complete
cf44434ebd3f: Pull complete
Digest: sha256:0ac31cc6a5dedc5301c01b1cf764f517f34f7fb7c84c8b0cc3f0e9db059a39fe
Status: Downloaded newer image for nginx:stable-perl
docker.io/library/nginx:stable-perlWhat's Next?View a summary of image vulnerabilities and recommendations → docker scout quickview nginx:stable-perl
luichun@luichun:~$

显示出这个nginx的镜像信息
在这里插入图片描述

luichun@luichun:~$ docker history nginx:stable-perl
IMAGE          CREATED       CREATED BY                                     
5e89d2c89523   2 weeks ago   RUN /bin/sh -c set -x;     NGINX_GPGKEY_PATH…   构建镜像时运行的命令,它设置了一些环境变量并导入了 Nginx 的 GPG 密钥。这可能用于验证软件包的完整性和安全性。--[与nginx:latest不同之处]<missing>      2 weeks ago   CMD ["nginx" "-g" "daemon off;"]                容器启动时要执行的命令为 nginx -g daemon off;
<missing>      2 weeks ago   STOPSIGNAL SIGQUIT                              使用STOPSIGNAL指令设置了容器的停止信号为SIGQUIT
<missing>      2 weeks ago   EXPOSE map[80/tcp:{}]                           使用EXPOSE指令暴露了容器的80端口
<missing>      2 weeks ago   ENTRYPOINT ["/docker-entrypoint.sh"]            使用ENTRYPOINT指令设置了容器的入口点为/docker-entrypoint.sh
<missing>      2 weeks ago   COPY 30-tune-worker-processes.sh /docker-ent…   复制了30-tune-worker-processes.sh文件    到/docker-entrypoint.d/目录中,
<missing>      2 weeks ago   COPY 20-envsubst-on-templates.sh /docker-ent…   复制了20-envsubst-on-templates.sh文件    到/docker-entrypoint.d/目录中,
<missing>      2 weeks ago   COPY 15-local-resolvers.envsh /docker-entryp…   复制了15-local-resolvers.envsh文件       到/docker-entrypoint.d/目录中,
<missing>      2 weeks ago   COPY 10-listen-on-ipv6-by-default.sh /docker…   复制了10-listen-on-ipv6-by-default.sh文件到/docker-entrypoint.d/目录中,
<missing>      2 weeks ago   COPY docker-entrypoint.sh / # buildkit          复制了docker-entrypoint.sh 文件到/ 目录中,根目录
<missing>      2 weeks ago   RUN /bin/sh -c set -x     && groupadd --syst…   执行了一系列命令,包括创建系统用户组等操作
<missing>      2 weeks ago   ENV PKG_RELEASE=1~bookworm                      设置了环境变量PKG_RELEASE为1~bookworm
<missing>      2 weeks ago   ENV NJS_RELEASE=2~bookworm                      设置了环境变量NJS_RELEASE为2~bookworm
<missing>      2 weeks ago   ENV NJS_VERSION=0.8.4                           设置了环境变量NJS_VERSION=0.8.4    
<missing>      2 weeks ago   ENV NGINX_VERSION=1.26.0                        设置了环境变量NGINX_VERSION=1.26.0       --[与nginx:latest不同之处]
<missing>      2 weeks ago   LABEL maintainer=NGINX Docker Maintainers <d…   添加了标签
<missing>      2 weeks ago   /bin/sh -c #(nop)  CMD ["bash"]                 使用CMD指令设置了容器启动时要执行的命令为bash
<missing>      2 weeks ago   /bin/sh -c #(nop) ADD file:4b1be1de1a1e5aa60…   添加了一个文件,但未给出文件名和具体内容。
luichun@luichun:~$

运行nginx1.26.0

在这里插入图片描述

# nginx -v
nginx version: nginx/1.26.0
# nginx -V
nginx version: nginx/1.26.0
built by gcc 12.2.0 (Debian 12.2.0-14) 
built with OpenSSL 3.0.9 30 May 2023 (running with OpenSSL 3.0.11 19 Sep 2023)
TLS SNI support enabled
configure arguments: 
--prefix=/etc/nginx 
--sbin-path=/usr/sbin/nginx 
--modules-path=/usr/lib/nginx/modules 
--conf-path=/etc/nginx/nginx.conf 
--error-log-path=/var/log/nginx/error.log 
--http-log-path=/var/log/nginx/access.log 
--pid-path=/var/run/nginx.pid 
--lock-path=/var/run/nginx.lock 
--http-client-body-temp-path=/var/cache/nginx/client_temp 
--http-proxy-temp-path=/var/cache/nginx/proxy_temp 
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp 
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp 
--http-scgi-temp-path=/var/cache/nginx/scgi_temp 
--user=nginx --group=nginx --with-compat 
--with-file-aio --with-threads 
--with-http_addition_module 
--with-http_auth_request_module 
--with-http_dav_module 
--with-http_flv_module 
--with-http_gunzip_module 
--with-http_gzip_static_module 
--with-http_mp4_module 
--with-http_random_index_module 
--with-http_realip_module 
--with-http_secure_link_module 
--with-http_slice_module 
--with-http_ssl_module 
--with-http_stub_status_module 
--with-http_sub_module 
--with-http_v2_module 
--with-http_v3_module 
--with-mail 
--with-mail_ssl_module 
--with-stream 
--with-stream_realip_module 
--with-stream_ssl_module 
--with-stream_ssl_preread_module 
--with-cc-opt='-g -O2 -ffile-prefix-map=/data/builder/debuild/nginx-1.26.0/debian/debuild-base/nginx-1.26.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC' 
--with-ld-opt='-Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie'

这篇关于docker镜像nginx1.26.0版本,与删除docker容器【灵异事件】的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/979086

相关文章

使用Docker构建Python Flask程序的详细教程

《使用Docker构建PythonFlask程序的详细教程》在当今的软件开发领域,容器化技术正变得越来越流行,而Docker无疑是其中的佼佼者,本文我们就来聊聊如何使用Docker构建一个简单的Py... 目录引言一、准备工作二、创建 Flask 应用程序三、创建 dockerfile四、构建 Docker

SpringBoot+Docker+Graylog 如何让错误自动报警

《SpringBoot+Docker+Graylog如何让错误自动报警》SpringBoot默认使用SLF4J与Logback,支持多日志级别和配置方式,可输出到控制台、文件及远程服务器,集成ELK... 目录01 Spring Boot 默认日志框架解析02 Spring Boot 日志级别详解03 Sp

Mysql实现范围分区表(新增、删除、重组、查看)

《Mysql实现范围分区表(新增、删除、重组、查看)》MySQL分区表的四种类型(范围、哈希、列表、键值),主要介绍了范围分区的创建、查询、添加、删除及重组织操作,具有一定的参考价值,感兴趣的可以了解... 目录一、mysql分区表分类二、范围分区(Range Partitioning1、新建分区表:2、分

Spring IoC 容器的使用详解(最新整理)

《SpringIoC容器的使用详解(最新整理)》文章介绍了Spring框架中的应用分层思想与IoC容器原理,通过分层解耦业务逻辑、数据访问等模块,IoC容器利用@Component注解管理Bean... 目录1. 应用分层2. IoC 的介绍3. IoC 容器的使用3.1. bean 的存储3.2. 方法注

MySQL 删除数据详解(最新整理)

《MySQL删除数据详解(最新整理)》:本文主要介绍MySQL删除数据的相关知识,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧... 目录一、前言二、mysql 中的三种删除方式1.DELETE语句✅ 基本语法: 示例:2.TRUNCATE语句✅ 基本语

java实现docker镜像上传到harbor仓库的方式

《java实现docker镜像上传到harbor仓库的方式》:本文主要介绍java实现docker镜像上传到harbor仓库的方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地... 目录1. 前 言2. 编写工具类2.1 引入依赖包2.2 使用当前服务器的docker环境推送镜像2.2

一文详解Git中分支本地和远程删除的方法

《一文详解Git中分支本地和远程删除的方法》在使用Git进行版本控制的过程中,我们会创建多个分支来进行不同功能的开发,这就容易涉及到如何正确地删除本地分支和远程分支,下面我们就来看看相关的实现方法吧... 目录技术背景实现步骤删除本地分支删除远程www.chinasem.cn分支同步删除信息到其他机器示例步骤

python删除xml中的w:ascii属性的步骤

《python删除xml中的w:ascii属性的步骤》使用xml.etree.ElementTree删除WordXML中w:ascii属性,需注册命名空间并定位rFonts元素,通过del操作删除属... 可以使用python的XML.etree.ElementTree模块通过以下步骤删除XML中的w:as

c++中的set容器介绍及操作大全

《c++中的set容器介绍及操作大全》:本文主要介绍c++中的set容器介绍及操作大全,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧... 目录​​一、核心特性​​️ ​​二、基本操作​​​​1. 初始化与赋值​​​​2. 增删查操作​​​​3. 遍历方

springboot项目打jar制作成镜像并指定配置文件位置方式

《springboot项目打jar制作成镜像并指定配置文件位置方式》:本文主要介绍springboot项目打jar制作成镜像并指定配置文件位置方式,具有很好的参考价值,希望对大家有所帮助,如有错误... 目录一、上传jar到服务器二、编写dockerfile三、新建对应配置文件所存放的数据卷目录四、将配置文