docker,

Pull Docker image using SHA256 hash

Apr 23, 2023 · 1 min read · Post a comment

Using Docker image hash over tags must be a better option from security standpoint although having a tag is much easier to remember and manage. And here’s how to pull images using hashes instead of tags.

Prerequisites

  • Docker

Solution

Step 1. For instance, you might want to pull Nginx proxy image, so first find that image hash from Docker Hub under Tags, by clicking the appropriate tag.

Step 2. Copy the hash and run the following command:

docker pull <image_name>@<sha256_hash>

Example:

docker pull jwilder/nginx-proxy@e7019781eaa3bac8658646ec9bf0e18d2643dfc8a788aac79e8c906b9e2b0785

Conclusion

In case nothing works, feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.