简体   繁体   English

mvn spring-boot:build-image 不会在 docker 中保存图像

[英]mvn spring-boot:build-image doesn't save image in docker

I tried to create a docker image with this command我尝试使用此命令创建 docker 映像

mvn spring-boot:build-image  

and it shows a successful result but when I search my docker images I can't find it.它显示了一个成功的结果,但是当我搜索我的 docker 图像时,我找不到它。 Does anyone know how to fix it?有谁知道如何修理它?

╰─⠠⠵ mvn spring-boot:build-image   
...
O]     [creator]     Saving docker.io/library/spring-service:0.0.16-SNAPSHOT...
[INFO]     [creator]     *** Images (f28300653802):
[INFO]     [creator]           docker.io/library/spring-service:0.0.16-SNAPSHOT
[INFO]     [creator]     Reusing cache layer 'paketo-buildpacks/syft:syft'
[INFO]     [creator]     Reusing cache layer 'cache.sbom'
[INFO] 
[INFO] Successfully built image 'docker.io/library/spring-service:0.0.16-SNAPSHOT'
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  28.784 s
[INFO] Finished at: 2022-09-01T18:19:01+04:30
[INFO] ------------------------------------------------------------------------


╰─⠠⠵ docker image ls
REPOSITORY                      TAG       IMAGE ID       CREATED        SIZE
mariadb                         <none>    01d138caf7d0   8 days ago     384MB
grafana/grafana                 latest    b6ea013786be   9 days ago     299MB
redis                           <none>    dc7b40a0b05d   9 days ago     117MB
bitnami/zookeeper               latest    dd7f87e04f7b   10 days ago    521MB
bitnami/kafka                   latest    c01437a78c04   12 days ago    664MB
prom/prometheus                 latest    d3167094f2ef   2 weeks ago    215MB
mariadb                         latest    40b966d7252f   4 weeks ago    383MB
redis                           latest    3e42dd4e79c7   4 weeks ago    117MB
emqx/emqx                       latest    42418de7f6c3   4 weeks ago    148MB
portainer/portainer-ce          2.11.1    ed396c816a75   6 months ago   280MB

Nothing to worry about, the creation of your Docker images works correctly.不用担心,您的 Docker 图像的创建工作正常。 You're just using a bit wrong command to search for newly created images.您只是使用了一个有点错误的命令来搜索新创建的图像。

The default «ls» command hides intermediate images.默认的 «ls» 命令隐藏中间图像。 You may check the details here: https://docs.docker.com/engine/reference/commandline/image_ls/您可以在此处查看详细信息: https://docs.docker.com/engine/reference/commandline/image_ls/

This one should display your newly created Docker image:这应该显示您新创建的 Docker 图像:

  docker image ls --all

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM