I have a situation where I need to wait for an image to show up on a given docker registry (this is an OpenShift external registry) before continuing my script with additional oc-commands.

Before that happens, the external docker registry has no knowledge what so ever of this image. Afterwards it is available as :latest.

Can this be done programatically? (Preferably without trying to download the image)

My order of preference:

  1. oc command
  2. docker command
  3. A REST api (using oc or docker credentials)

1 Answers

0
wotanii On

assuming the repository from openshift works similarly to dockerhub, you can do this:

curl --silent -f -lSL https://index.docker.io/v1/repositories/$1/tags/$2 > /dev/null 

source