Search code examples
dockersalt-project

pull all docker images in saltstack


I would like to pull all tags from a Docker registry with SaltStack.

To pull all tags from a specific registry in Docker you can use: docker pull --all-tags user/registry

In SaltStack I'm using dockerng but:

  • with image.present I can't specify to have all tags present.
  • With dockerng.pull user/registry I also can't specify to pull all tags.

Any help would be appreciated :)


Alternatively I could pull a specific tag from the registry if I would know which tags are available. As far as I know it's not possible to see which tags are available in the registry....


Solution

  • Without diggin into dockerng state at all. You can always achieve this using the cmd.run state:

    docker pull --all-tags user/registy:
      cmd.run
    

    Nevertheless i usually prefer using the states like you tried. If this case is not covered yet, you might file an issue in saltstack and solve it for now using cmd.run.