I have the following script to push my image using Travis CI build pipeline:
#!/usr/bin/env bash
if [ $TRAVIS_BRANCH == “master” ]; then
echo “$DOCKER_PASSWORD” | docker login -u “$DOCKER_REGISTRY_USERNAME” --password-stdin;
docker build -t $DOCKER_APP_NAME .;
docker images;
docker tag $DOCKER_APP_NAME $DOCKER_REGISTRY_USERNAME/$DOCKER_APP_NAME;
echo “Pushing image $DOCKER_APP_NAME to repository $DOCKER_REGISTRY_URL”;
docker push $DOCKER_TAG_NAME;
docker push $DOCKER_REGISTRY_USERNAME/$DOCKER_APP_NAME;
fi
When I execute the build pipeline, I get to see the following error:
Successfully tagged [secure]
REPOSITORY TAG IMAGE ID CREATED SIZE
Docker 1.0-SNAPAHOT e74c33326bb3 Less than a second ago 227MB
anapsix/alpine-java jdk8 ed55c27d366d 3 years ago 171MB
Pushing image [secure] to repository hub.docker.com
The push refers to repository [docker.io/[secure]/plant-simulator]
An image does not exist locally with the tag: [secure]/plant-simulator
The push refers to repository [docker.io/[secure]/hub.docker.com/[secure]/plant-simulator]
8c08446ff254: Preparing
aaecc90e7c56: Preparing
02bf7502d0a8: Preparing
d5ead368c960: Preparing
4fe15f8d0ae6: Preparing
denied: requested access to the resource is denied
The command “bash docker_push.sh” exited with 1.
I checked my repo in docker hub and it is indeed set to public, but nevertheless I get this error. I also see something like this printed in the travis ci build logs:
19.33s$ bash docker_push.sh
720Error: Cannot perform an interactive login from a non TTY device
721Sending build context to Docker daemon 352.1MB
722Step 1/15 : FROM anapsix/alpine-java:jdk8
723jdk8: Pulling from anapsix/alpine-java
Why do I get the interactive login error? Could this be the reason?