Skip to content

docker-credential-pass

Official Golang Docs!

Installation (Ubuntu)

# Do this all as sudo
sudo su

# Install Golang
wget https://go.dev/dl/go1.20.2.linux-amd64.tar.gz

# Remove potential old golang and unzip new tar
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.20.2.linux-amd64.tar.gz

# Add this line to any RC profile and `source` it
export PATH=$PATH:/usr/local/go/bin

# Ensure GO installation
go version

# Get the repo
git clone https://github.com/docker/docker-credential-helpers.git
cd docker-credential-helpers

# You may have to tell git this is safe
git config --global --add safe.directory /usr/local/share/docker-credential-helpers

# Build for the project you want (probably `pass`)
make pass

# Move build to shared bin/
cp ./bin/build/docker-credential-pass /usr/local/bin/

Official docker-credential-helpers Docs!

Setup

Edit ~/.docker/config.json and point credsStore to "pass".

{
    "credsStore": "pass"
}

Notes

Now you can run docker login {site} and you'll be prompted for the username and password as normal. However, when you login this time, instead of your credentials getting saved as plaintext in ~/.docker/config, docker will see that you're using pass, and instead save it in pass itself.

** You may be prompted for the pass passphrase.