Job exits out as “succeeded” but not all images are pushed and no error output Docker+GitLab CI

I’m creating this thread because this is the first time after long time I’ve encountered issue with Docker when running in GitLab’s CI tool.

I’m using GitLab’s CI tool to push Docker images into ECR on AWS and the job exits out as “succeeded” but not all images are pushed. And I get no errors output to analyze.
I put comments on relevant lines to describe behaviour.

Please ask for any details. I’m happy to provide screenshots as well.

part of my “pusher” script:

if [ "$GITLAB_BRANCH" == "staging" ] || \
     [ "$GITLAB_BRANCH" == "production" ]
  then
    docker build $USERS_REPO -t $USERS:$COMMIT -f Dockerfile-$DOCKER_ENV
    docker tag $USERS:$COMMIT $REPO/$USERS:$TAG
    docker push $REPO/$USERS:$TAG

    docker build $USERS_DB_REPO -t $USERS_DB:$COMMIT -f Dockerfile
    docker tag $USERS_DB:$COMMIT $REPO/$USERS_DB:$TAG
    docker push $REPO/$USERS_DB:$TAG

    docker build $SWAGGER_REPO -t $SWAGGER:$COMMIT -f Dockerfile-$DOCKER_ENV
    docker tag $SWAGGER:$COMMIT $REPO/$SWAGGER:$TAG
    docker push $REPO/$SWAGGER:$TAG

    echo "building the client image ..."    # executed
    docker -D build $CLIENT_REPO -t $CLIENT:$COMMIT -f Dockerfile-prod --build-arg REACT_APP_USERS_SERVICE_URL=""    # something happens here but no error output
    echo "tagging the client image ..."       # skipped
    docker -D tag $CLIENT:$COMMIT $REPO/$CLIENT:$TAG   # skipped
    echo "pushing the client image ..."   # skipped
    docker -D push 274725968600.dkr.ecr.eu-west-2.amazonaws.com/test-driven-client:production   # skipped
  fi
fi

Any feedback that leads to solution much appreciated.