skip to Main Content

I am having trouble getting Docker to use a specific commit hash of an image. I want to use the image with SHA1 hash 1e0561c5cb6eba1e379f4c91648a2df8297059cc, but when I run the command "docker compose –profile auto up –build", the latest version is used instead. The Docker Compose YAML file is included in the question.

I have tried specifying the image with the full hash in the Docker Compose file, but it still pulls the latest version. Is there a way to force Docker to use the specific commit hash I want? Any help would be appreciated.

For reference, the image in question is located on this GitHub repository: https://github.com/AUTOMATIC1111/stable-diffusion-webui

2

Answers


  1. You can force Docker to use a specific image with following syntax:

    NAME:[TAG@DIGEST]
    

    If this doesnt work you should give us more information.

    Login or Signup to reply.
  2. In order to pull a docker image with its own SHA you have to follow the below syntax

    shell command

    docker pull ubuntu@sha256:26c68657ccce2cb0a31b330cb0be2b5e108d467f641c62e13ab40cbec258c68d
    

    docker compose example

    services:
      web:
        image: ubuntu@sha256:26c68657ccce2cb0a31b330cb0be2b5e108d467f641c62e13ab40cbec258c68d
    

    Example of official Nginx image where you can get the full sha here

    Official Documentation here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search