docker在往远程push镜像的时候,今天突然push不上去,代码如下?

以往用的好好的,今天突然不能用了
本地maven打包后,启动docker desktop,然后执行下面的脚本打镜像并往远程仓库push

1.从如下代码能看出问题可能出在哪里吗?
2.执行脚本后,是不是已经打好了镜像,只是push失败而已?那打的镜像在哪里呢,通过docker desktop这个软件也没发现打的镜像存到了哪里呀
这是执行的脚本

@echo off

echo --------------------------------自定义参数,启动前先修改--------------------------------------

set jarName=cosmo-base-service-0.0.1-SNAPSHOT.jar

set profile=seamom

set imageURI=reg-sg-hw.demo.net/overseamom_gitlab/mes-base

rem echo 获取当前日期字符串

for /f "tokens=1,2,3 delims=/- " %%a in ("%date%") do @set D=%%a%%b%%c

rem echo 获取当前时间字符串

for /f "tokens=1,2 delims=:." %%a in ("%time%") do @set T=%%a%%b

rem echo 如当前小时小于10,将空格替换为0

set T=%T: =0%

rem echo 显示输出日期时间字符串

set imageVersion=%D%%T%

::输出发版信息

echo jar包名称:%jarName%

echo 启动环境:%profile%

echo 镜像库地址:%imageURI%

echo 镜像版本:%imageVersion%

echo --------------------------------mvn package...--------------------------------

::call mvn clean package -Dmaven.test.skip=true

cd .\target

SET df=Dockerfile

if exist %df% (

del /f /s /q .\Dockerfile

)

echo --------------------------------创建Dockerfile--------------------------------

echo FROM registry.demo.net/library/openjdk:8-sw66 >> Dockerfile

echo ENV SW_AGENT_COLLECTOR_BACKEND_SERVICES=oap.apm.demo.net:26733 >> Dockerfile

echo RUN cp /usr/share/zoneinfo/Asia/Bangkok /etc/localtime >> Dockerfile

echo RUN echo Asia/Bangkok ^> /etc/timezone >> Dockerfile

echo COPY %jarName% /application.jar >> Dockerfile

echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile

dir

echo --------------------------------docker login...-------------------------------

docker login reg-sg-hw.demo.net -u swswsw -p 333344552345

echo --------------------------------docker build...-------------------------------

docker build -t %imageURI%:%imageVersion% .

echo --------------------------------docker push...--------------------------------

docker push %imageURI%:%imageVersion%

@pause

这是脚本执行控制台的打印

--------------------------------自定义参数,启动前先修改--------------------------------------

jar包名称:cosmo-base-service-0.0.1-SNAPSHOT.jar

启动环境:seamom

镜像库地址:reg-sg-hw.demo.net/overseamom_gitlab/mes-base

镜像版本:202306301435

--------------------------------mvn package...--------------------------------

删除文件 - C:\Users\issuser\Desktop\suiwei\code\mes\cosmo-mes-base-web\cosmo-base-service\target\Dockerfile

--------------------------------创建Dockerfile--------------------------------

驱动器 C 中的卷没有标签。

卷的序列号是 265A-5882

C:\Users\issuser\Desktop\suiwei\code\mes\cosmo-mes-base-web\cosmo-base-service\target 的目录

2023/06/30 14:35 <DIR> .

2023/06/30 14:35 <DIR> ..

2023/06/30 11:30 <DIR> classes

2023/06/29 21:54 100,504,208 cosmo-base-service-0.0.1-SNAPSHOT.jar

2023/06/29 21:54 2,932,639 cosmo-base-service-0.0.1-SNAPSHOT.jar.original

2023/06/29 21:54 <DIR> coverage-reports

2023/06/30 14:35 351 Dockerfile

2023/06/29 21:54 <DIR> generated-sources

2023/06/30 11:23 <DIR> generated-test-sources

2023/06/29 21:54 <DIR> maven-archiver

2023/06/29 21:54 <DIR> maven-status

2023/06/29 21:56 <DIR> surefire

2023/06/30 11:23 <DIR> test-classes

3 个文件 103,437,198 字节

10 个目录 21,957,513,216 可用字节

--------------------------------docker login...-------------------------------

WARNING! Using --password via the CLI is insecure. Use --password-stdin.

Login Succeeded

--------------------------------docker build...-------------------------------

[+] Building 0.6s (9/9) FINISHED

=> [internal] load .dockerignore 0.0s

=> => transferring context: 2B 0.0s

=> [internal] load build definition from Dockerfile 0.0s

=> => transferring dockerfile: 390B 0.0s

=> [internal] load metadata for registry.demo.net/library/openjdk:8-sw66 0.5s

=> [1/4] FROM registry.demo.net/library/openjdk:8-sw66@sha256:e3a75c6591c8aa7bf8fc5edf51685af8930ffb1689bc31efd842ebdd0aa1200d 0.0s

=> [internal] load build context 0.0s

=> => transferring context: 61B 0.0s

=> CACHED [2/4] RUN cp /usr/share/zoneinfo/Asia/Bangkok /etc/localtime 0.0s

=> CACHED [3/4] RUN echo Asia/Bangkok > /etc/timezone 0.0s

=> CACHED [4/4] COPY cosmo-base-service-0.0.1-SNAPSHOT.jar /application.jar 0.0s

=> exporting to image 0.0s

=> => exporting layers 0.0s

=> => writing image sha256:7c18be0c21f055c3d38c6426cad8df6b23432dfb2edb2009f641b569aec93965 0.0s

=> => naming to reg-sg-hw.demo.net/overseamom_gitlab/mes-base:202306301435 0.0s

--------------------------------docker push...--------------------------------

The push refers to repository [reg-sg-hw.demo.net/overseamom_gitlab/mes-base]

39a4d9b25d34: Pushing [==================================================>] 100.5MB

9fe50a8caed3: Pushing [==================================================>] 2.56kB

6c903714372d: Pushing [==================================================>] 4.096kB

ffd9ba8598c5: Pushing [==================================================>] 20.77MB

fa598e544fbb: Pushing [==================================================>] 4.608kB

be8e23f0fcc8: Pushing [==================================================>] 3.584kB

4d12c2db2fbb: Pushing [==================================================>] 4.096kB

732b36256550: Pushing [==================================================>] 4.096kB

ce774c89362c: Pushing [======================================> ] 41.95MB/54.09MB

ac3e2c206c49: Pushing [=======================> ] 95.22MB/205.1MB

3663b7fed4c9: Pushing [==================================================>] 3.584kB

832f129ebea4: Pushing [==================================================>] 11.52MB

6670e930ed33: Pushing [==================================================>] 149.9MB

c7f27a4eb870: Pushing [==================================================>] 17.85MB

e70dfb4c3a48: Pushing [=======> ] 2.634MB/16.48MB

1c76bd0dc325: Waiting

EOF

请按任意键继续. . .

本地查镜像

C:\Users\issuser>docker images

REPOSITORY TAG IMAGE ID CREATED SIZE

reg-sg-hw.haier.net/overseamom_gitlab/mes-base 202306292201 7c18be0c21f0 17 hours ago 685MB

reg-sg-hw.haier.net/overseamom_gitlab/mes-base 202306301148 7c18be0c21f0 17 hours ago 685MB

reg-sg-hw.haier.net/overseamom_gitlab/mes-base 202306301325 7c18be0c21f0 17 hours ago 685MB

reg-sg-hw.haier.net/overseamom_gitlab/mes-base 202306301355 7c18be0c21f0 17 hours ago 685MB

reg-sg-hw.haier.net/overseamom_gitlab/mes-base 202306301401 7c18be0c21f0 17 hours ago 685MB

reg-sg-hw.haier.net/overseamom_gitlab/mes-base 202306301432 7c18be0c21f0 17 hours ago 685MB

reg-sg-hw.haier.net/overseamom_gitlab/mes-base 202306301435 7c18be0c21f0 17 hours ago 685MB

reg-sg-hw.haier.net/overseamom_gitlab/mes-web 202306292126 eb9a55dde791 18 hours ago 956MB

reg-sg-hw.haier.net/overseamom_gitlab/mes-base 202306292126 602b0c8787e1 18 hours ago 685MB

hello-world latest 9c7a54a9a43c 8 weeks ago 13.3kB


回答:

自建的网络带宽不太好吧

以上是 docker在往远程push镜像的时候,今天突然push不上去,代码如下? 的全部内容, 来源链接: utcz.com/p/945229.html

回到顶部