Another way that worked:
echo ${DOCKERHUB_PASSWORD} | docker login -u "$DOCKERHUB_USERNAME" --password-stdin