Last active
September 18, 2022 07:15
-
-
Save darkn3rd/bd94feb6912d1d5a552ae17e20bbb00c to your computer and use it in GitHub Desktop.
GKE NSM2: docker_keys.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
PRIV_REG="private-registry.nginx.com" | |
if [[ "$(uname -s)" == "Linux" ]]; then | |
DOCKER_CERTS_PATH="/etc/docker/certs.d/$PRIV_REG" | |
sudo mkdir -p $DOCKER_CERTS_PATH | |
elif [[ "$(uname -s)" == "Darwin" ]]; then | |
DOCKER_CERTS_PATH="$HOME/.docker/certs.d/$PRIV_REG" | |
mkdir -p $DOCKER_CERTS_PATH | |
fi | |
# copy local cert/key to Linux or macOS cert path | |
if [[ -f nginx-repo.crt || -f nginx-repo.key ]]; then | |
cp nginx-repo.crt $DOCKER_CERTS_PATH/client.cert | |
cp nginx-repo.key $DOCKER_CERTS_PATH/client.key | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment