Configure Repository Credentials
Use this procedure to configure your repository login credentials in your manifests.
- Install docker if you don't already have docker installed.
-
Log in to the Juniper Networks repository where you pull the container images.
docker login enterprise-hub.juniper.net
Enter your login credentials when prompted.
Once you've logged in, your credentials are automatically stored in ~/.docker/config.json. (If you installed docker using snap, then the credentials are stored in the ~/snap/docker directory hierarchy.)
-
Encode your credentials in base64 and store the resulting string.
Take a look at the encoded credentials.ENCODED_CREDS=$(base64 -w 0 config.json)
echo $ENCODED_CREDS
-
Replace the credentials placeholder in the manifests with the encoded
credentials.
The manifests have a
<base64-encoded-credential>
credentials placeholder. Simply replace the placeholder with the encoded credentials in all manifests. Double check by searching for the encoded credentials in the manifests.sed -i s/'<base64-encoded-credential>'/$ENCODED_CREDS/ *.yaml
You should see the encoded credentials in the manifests.grep $ENCODED_CREDS *.yaml