Secure Docker login

I’ve implemented a repository that automatically builds and publishes a Docker image using GitHub Workflows. The URL of this repository is:

While it works, I get the following warning:

WARNING! Your password will be stored unencrypted in /home/runner/.docker/config.json.

Configure a credential helper to remove this warning. See

The command I use to login is:

echo "$MY_PASSWORD" | docker login -u ${{ }} --password-stdin

What are my options to more securely log in?

I wouldn’t worry about that warning unless you think that someone can access that runner during its temporary existence Let’s say you were running it on a company laptop during a demo and then you gave it to a colleague who could see your password. That would be a problem. Since the same Docker CLI is running on the GitHub runner, you will get this warning.