create_docker_build_env:
...
rules:
- changes:
- Dockerfile
when: always
- if: $CI_REGISTRY_IMAGE/build_env:latest ?does not exist?
when: always
- when: never
I have a CI task that creates a docker container that is used for CI builds. There is a rule that rebuilds the container each time the dockerfile changes. Unfortunately, it doesn't work in case of forks: whoever will fork the repo will end up with the failed build, since they don't have the needed containers. Is there a way to make a condition based on existence of the docker container?