Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Common mistakes and Solutions in using Docker

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Today, the editor will bring you an article about common mistakes and solutions in using Docker. The editor thinks it is very practical, so I will share it for you as a reference. Let's follow the editor and have a look.

Operating system: CentOS Linux release 7.5.1804

Container engine: Docker version 19.03.7

Actual combat task: describe and solve problems.

1. Fixed the problem that the docker image could not be deleted because the deletion failed because the REPOSITORY shared an IMAGE ID.

[root@docker sky9890] # docker rmi $(docker images-Q)

Error response from daemon: conflict: unable to delete 5766334bdaa0 (must be forced)-image is

Referenced in multiple repositories

Error response from daemon: conflict: unable to delete 5766334bdaa0 (must be forced)-image is

Referenced in multiple repositories

Error response from daemon: conflict: unable to delete 5766334bdaa0 (must be forced)-image is

Referenced in multiple repositories

# deleting one by one can solve the problem

[root@docker sky9890] # docker rmi nginx:v1

[root@docker sky9890] # docker rmi nginx:1.11

[root@docker sky9890] # docker rmi nginx

two。 Encounter the solution that you can't delete image Error: No such images

[root@docker sky9890] # docker image rm $(docker image ls-a-Q)

Error: No such image: 4e7840b49fad

Error: No such image: a1523e859360

Error: No such image: 0320ef7199ca

[root@docker sky9890] # docker rmi centos:latest

Error: No such image: centos:latest

[root@docker sky9890] # docker rmi 470671670cac

Error: No such image: 470671670cac

# just delete the cache file under sha256

[root@docker docker] # cd / var/lib/docker/image/overlay2/imagedb/content/sha256/

[root@docker sha256] # ll

Total dosage 96

-rw-. 1 root root 8983 March 2 12:35

0320ef7199cad90e23f7d5688a47beab304280b000284e0bd7fdad162ff5c9ec

-rw-. 1 root root 2797 March 2 12:28

470671670cac686c7cf0081e0b37da2e9f4f768ddc5f6a26102ccd1c6954c1ee

-rw-. 1 root root 14511 March 2 12:11

.

[root@docker sha256] # rm *

[root@docker sha256] # ll

Total dosage 0

3.mount parameter will be reported to Docker Unknown flag-- mount

The reasons are as follows:

Docker run support for the-- mount option was only introduced in Docker 17.06. You are using Docker 1.13.1. You have two choices:

1. Update to Docker 17.06 or later if you can

2. Use the-v approach to bind mount the volume you require e.g. Docker run-v $(pwd): / home

Workaround: upgrade the docker version

These are the details of the common mistakes and solutions of Docker. Have you learned anything after reading them? If you want to know more about it, you are welcome to follow the industry information!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report