Get the App
SLTechnology News&Howtos  ›  Servers  › 

Common mistakes and Solutions in using Docker

Shulou Source: shulou.com Published: 2022-06-03 05:51:29 09月21日 Update

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!

Tags: Problems methods common errors content reasons usage practicality for this purpose operating systems tasks methods parameters actual combat containers that is engines files articles more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Shulou Technology Microsoft Linux Redmi