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

相关文章

Python版本与package版本兼容性检查方法总结

《Python版本与package版本兼容性检查方法总结》:本文主要介绍Python版本与package版本兼容性检查方法的相关资料,文中提供四种检查方法,分别是pip查询、conda管理、PyP... 目录引言为什么会出现兼容性问题方法一:用 pip 官方命令查询可用版本方法二:conda 管理包环境方法

解决docker目录内存不足扩容处理方案

《解决docker目录内存不足扩容处理方案》文章介绍了Docker存储目录迁移方法:因系统盘空间不足,需将Docker数据迁移到更大磁盘(如/home/docker),通过修改daemon.json配... 目录1、查看服务器所有磁盘的使用情况2、查看docker镜像和容器存储目录的空间大小3、停止dock

Linux命令rm如何删除名字以“-”开头的文件

《Linux命令rm如何删除名字以“-”开头的文件》Linux中,命令的解析机制非常灵活,它会根据命令的开头字符来判断是否需要执行命令选项,对于文件操作命令(如rm、ls等),系统默认会将命令开头的某... 目录先搞懂:为啥“-”开头的文件删不掉?两种超简单的删除方法(小白也能学会)方法1:用“--”分隔命

docker 重命名镜像的实现方法

《docker重命名镜像的实现方法》在Docker中无法直接重命名镜像,但可通过添加新标签、删除旧镜像后重新拉取/构建,或在DockerCompose中修改配置文件实现名称变更,感兴趣的可以了解一下... 目录使用标签(Tagging)删除旧的php镜像并重新拉取或构建使用docker Compose在Do

C#自动化实现检测并删除PDF文件中的空白页面

《C#自动化实现检测并删除PDF文件中的空白页面》PDF文档在日常工作和生活中扮演着重要的角色,本文将深入探讨如何使用C#编程语言,结合强大的PDF处理库,自动化地检测并删除PDF文件中的空白页面,感... 目录理解PDF空白页的定义与挑战引入Spire.PDF for .NET库核心实现:检测并删除空白页

Java JUC并发集合详解之线程安全容器完全攻略

《JavaJUC并发集合详解之线程安全容器完全攻略》Java通过java.util.concurrent(JUC)包提供了一整套线程安全的并发容器,它们不仅是简单的同步包装,更是基于精妙并发算法构建... 目录一、为什么需要JUC并发集合?二、核心并发集合分类与详解三、选型指南:如何选择合适的并发容器?在多

python语言中的常用容器(集合)示例详解

《python语言中的常用容器(集合)示例详解》Python集合是一种无序且不重复的数据容器,它可以存储任意类型的对象,包括数字、字符串、元组等,下面:本文主要介绍python语言中常用容器(集合... 目录1.核心内置容器1. 列表2. 元组3. 集合4. 冻结集合5. 字典2.collections模块

docker编写java的jar完整步骤记录

《docker编写java的jar完整步骤记录》在平常的开发工作中,我们经常需要部署项目,开发测试完成后,最关键的一步就是部署,:本文主要介绍docker编写java的jar的相关资料,文中通过代... 目录all-docker/生成Docker打包部署文件配置服务A的Dockerfile (a/Docke

Spring Boot中获取IOC容器的多种方式

《SpringBoot中获取IOC容器的多种方式》本文主要介绍了SpringBoot中获取IOC容器的多种方式,包括直接注入、实现ApplicationContextAware接口、通过Spring... 目录1. 直接注入ApplicationContext2. 实现ApplicationContextA

linux配置podman阿里云容器镜像加速器详解

《linux配置podman阿里云容器镜像加速器详解》本文指导如何配置Podman使用阿里云容器镜像加速器:登录阿里云获取专属加速地址,修改Podman配置文件并移除https://前缀,最后拉取镜像... 目录1.下载podman2.获取阿里云个人容器镜像加速器地址3.更改podman配置文件4.使用po