cannot login with docker hub personal access token

Currently I cannot login with docker hub personal access token. Since recently I have enabled 2FA using username or password is not solution. I have changed password to personal access token . I am getting error cannot perform an interactive login from a non TTY device . I am using

echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin

 to login

4 Likes