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

相关文章

Java实现删除文件中的指定内容

《Java实现删除文件中的指定内容》在日常开发中,经常需要对文本文件进行批量处理,其中,删除文件中指定内容是最常见的需求之一,下面我们就来看看如何使用java实现删除文件中的指定内容吧... 目录1. 项目背景详细介绍2. 项目需求详细介绍2.1 功能需求2.2 非功能需求3. 相关技术详细介绍3.1 Ja

使用jenv工具管理多个JDK版本的方法步骤

《使用jenv工具管理多个JDK版本的方法步骤》jenv是一个开源的Java环境管理工具,旨在帮助开发者在同一台机器上轻松管理和切换多个Java版本,:本文主要介绍使用jenv工具管理多个JD... 目录一、jenv到底是干啥的?二、jenv的核心功能(一)管理多个Java版本(二)支持插件扩展(三)环境隔

Redis过期删除机制与内存淘汰策略的解析指南

《Redis过期删除机制与内存淘汰策略的解析指南》在使用Redis构建缓存系统时,很多开发者只设置了EXPIRE但却忽略了背后Redis的过期删除机制与内存淘汰策略,下面小编就来和大家详细介绍一下... 目录1、简述2、Redis http://www.chinasem.cn的过期删除策略(Key Expir

MySQL版本问题导致项目无法启动问题的解决方案

《MySQL版本问题导致项目无法启动问题的解决方案》本文记录了一次因MySQL版本不一致导致项目启动失败的经历,详细解析了连接错误的原因,并提供了两种解决方案:调整连接字符串禁用SSL或统一MySQL... 目录本地项目启动报错报错原因:解决方案第一个:第二种:容器启动mysql的坑两种修改时区的方法:本地

conda安装GPU版pytorch默认却是cpu版本

《conda安装GPU版pytorch默认却是cpu版本》本文主要介绍了遇到Conda安装PyTorchGPU版本却默认安装CPU的问题,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的... 目录一、问题描述二、网上解决方案罗列【此节为反面方案罗列!!!】三、发现的根本原因[独家]3.1 p

Redis指南及6.2.x版本安装过程

《Redis指南及6.2.x版本安装过程》Redis是完全开源免费的,遵守BSD协议,是一个高性能(NOSQL)的key-value数据库,Redis是一个开源的使用ANSIC语言编写、支持网络、... 目录概述Redis特点Redis应用场景缓存缓存分布式会话分布式锁社交网络最新列表Redis各版本介绍旧

IIS 7.0 及更高版本中的 FTP 状态代码

《IIS7.0及更高版本中的FTP状态代码》本文介绍IIS7.0中的FTP状态代码,方便大家在使用iis中发现ftp的问题... 简介尝试使用 FTP 访问运行 Internet Information Services (IIS) 7.0 或更高版本的服务器上的内容时,IIS 将返回指示响应状态的数字代

使用C#删除Excel表格中的重复行数据的代码详解

《使用C#删除Excel表格中的重复行数据的代码详解》重复行是指在Excel表格中完全相同的多行数据,删除这些重复行至关重要,因为它们不仅会干扰数据分析,还可能导致错误的决策和结论,所以本文给大家介绍... 目录简介使用工具C# 删除Excel工作表中的重复行语法工作原理实现代码C# 删除指定Excel单元

Python对PDF书签进行添加,修改提取和删除操作

《Python对PDF书签进行添加,修改提取和删除操作》PDF书签是PDF文件中的导航工具,通常包含一个标题和一个跳转位置,本教程将详细介绍如何使用Python对PDF文件中的书签进行操作... 目录简介使用工具python 向 PDF 添加书签添加书签添加嵌套书签Python 修改 PDF 书签Pytho

ubuntu如何部署Dify以及安装Docker? Dify安装部署指南

《ubuntu如何部署Dify以及安装Docker?Dify安装部署指南》Dify是一个开源的大模型应用开发平台,允许用户快速构建和部署基于大语言模型的应用,ubuntu如何部署Dify呢?详细请... Dify是个不错的开源LLM应用开发平台,提供从 Agent 构建到 AI workflow 编排、RA