-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace docker-image-not-found in CircleCI publish workflow #1142
Comments
Recap
A solution for checking if an image has already been published to Docker Hub is needed which covers both the older Solution suggestionUsing the Docker HUB API (beta)'s Check repository tag with the following format it is possible to replace the outdated npm module docker-image-not-found. The API does not require a Docker client and is therefore independent of any Docker engine version installed: https://hub.docker.com/v2/namespaces/{namespace}/repositories/{repository}/tags/{tag} For instance curl -s https://hub.docker.com/v2/namespaces/cypress/repositories/factory/tags/4.0.2 | grep -iq 'httperror 404'
echo $?
curl -s https://hub.docker.com/v2/namespaces/cypress/repositories/factory/tags/missing | grep -iq 'httperror 404'
echo $?
respectively, exactly as docker-image-not-found does. Additionally the API is able to cope with images that have an imageType
and executing this command against the curl -s https://hub.docker.com/v2/namespaces/library/repositories/ubuntu/tags/jammy | grep -iq 'httperror 404'
echo $?
Note that the experimental Docker command docker manifest inspect in the currently used Docker engine |
What would you like?
The npm module docker-image-not-found, sourced from the repo cypress-io/docker-image-not-found, is out of date and should be replaced.
Why is this needed?
The npm module docker-image-not-found is on the critical path for releasing Cypress Docker images to the repositories Docker Hub and Amazon ECR (Elastic Container Registry) Public Gallery.
The module is used in the CircleCI workflow command
halt-if-docker-image-exists
.docker-image-not-found (current
latest
), which was released in March 2020, is not compatible with default multi-architecture manifests using OCI formats. If an OCI type image exists, thendocker-image-not-found
reports the same1
return code as for an existingdocker
manifest image. The error log however shows that there has been a problem evaluating the manifest, leading to loss of confidence in the module's reliability.The following issues would need to be resolved in order to continue to use it in the medium term:
Considering that its only function is to check for the existence of an image, the effort to update it to current environments is out of proportion to its benefit. The original repo https://github.com/mishguruorg/docker-image-exists, from which it was forked, was last updated 7 years ago and would not be helpful for any update.
Other
Related
The text was updated successfully, but these errors were encountered: