I try to get .Config.Labels from parament image in post_push, but this function does not work since July 6th 2021 because docker build cannot find the target docker image.
My repositpories:
_
_
(Both are private repository)
__ depends on __, what I want to do is retrieving "_version_" info from "__" image and add the version info in the docker tag of the new built __ image. To achieve that, I have code in my _post_push_ script like:
```
VERSION=`docker inspect --format '{{ index .Config.Labels "version"}}' ${IMAGE_NAME}`
RAI_VER=`docker inspect --format '{{ index .Config.Labels "version"}}' :v1_latest`
DOCKER_TAG1="${VERSION}"-rai"${RAI_VER}"
docker tag $IMAGE_NAME ${DOCKER_REPO}:$DOCKER_TAG1
docker push ${DOCKER_REPO}:$DOCKER_TAG1
```
This worked well in the past:
```
...
Executing post_push hook...
BRANCH: master
The push refers to repository [docker.io//tools]
...
```
but starting from July 6th, this function failed with following error which is shown in build log:
```
...
Executing post_push hook...
WARNING: Support for the legacy ~/.dockercfg configuration file and file-format is deprecated and will be removed in an upcoming release
WARNING: Support for the legacy ~/.dockercfg configuration file and file-format is deprecated and will be removed in an upcoming release
WARNING: Support for the legacy ~/.dockercfg configuration file and file-format is deprecated and will be removed in an upcoming release
Error: No such object: :v1_latest
...
```
While tag _:v1_latest_ does exit in my repositiry,
I wonder this is because of docker hub security policy change or command change? Is this a regression of docker hub build? Is there a workaround to mitigate the problem, or will docker hub provide a fix for this issue?
Thanks!
Problem description
I try to get .Config.Labels from parament image in post_push, but this function does not work since July 6th 2021 because docker build cannot find the target docker image.
My repositpories: _