I downloaded a MySql image locally and want to install the official one.
docker pull mysqlAfter that, it always automatically installed the local ones.
Delete local mysql
docker rmi -f mysql
docker imagesThe check is gone, but
docker pull mysql, found that the installation is still the previous …
How to skip the local MySql and install the official image? Thank you
Is there any container using this mysql image? Or do you want to start over
docker tagThrough this mirror image? Or use other versions of mysql images? Or in the use of
debian:jessieA mirror image of?
It is important to know that mirroring is not a single file, but a collection of storage tiers. When you execute
docker rmi -f mysqlWhen, in fact, is deleted
tagSo the first line is generally
The next logic is that if there is nothing else
tagPointing to the storage layer will actually delete the storage layer, and then continue to query whether the storage layer of the next layer is still in use, and will not continue to delete until a layer finds that there are containers or mirrors that depend on the storage layer, and then stop deleting. So when you execute
docker rmiWhen, can observe how many appeared
Deleted: sha256: ...This is how many layers have been deleted and the others have not.
So if you start over
docker tagThe mysql image, then when you execute
docker rmiWhen, will only be executed
untagWithout actually deleting the storage tier.
Or the system has other images based on the same basic image
docker rmiAlso will only delete to this layer will stop, after every time
pullIt also starts from this floor.
Similarly, this concept of tiered storage will also affect you
docker pull. When you execute
docker pullWhen, will check the official
docker:latestThe check value of each layer of the, and then to the local comparison, see which already exist, if there is not repeat pull, directly use the current storage layer, pull the new if there is no.
Take what you just said. If you try again
docker tagFor example, if you re-start before
tagGo through this
mysql:latestMirror image, then
docker rmiThe mirror is not actually deleted and again
docker pull mysqlWhen I found that all storage layers are locally available, it is inevitable that I don’t need to pull again and directly transfer the top layer
mysql:latestJust. There is no need to worry about this situation or force it to be downloaded again, because
sha256sumIt can ensure the consistency between the image file and the official website.
So your question depends on the specific situation. Generally speaking, it is not recommended in production environment.
latestLabel, but explicitly specify the version, so that maintenance can be upgraded.