简体   繁体   中英

Google Cloud SQL Proxy issues passing credentials file

From the docs here :

docker run -d \
  -v <PATH_TO_KEY_FILE>:/config \
  -p 127.0.0.1:5432:5432 \
  gcr.io/cloudsql-docker/gce-proxy:1.16 /cloud_sql_proxy \
  -instances=<INSTANCE_CONNECTION_NAME>=tcp:0.0.0.0:5432 -credential_file=/config

My version

docker run -d \
    -v ssh-master-account-key.json:/config \
    -p 127.0.0.1:5432:5432 \
    gcr.io/cloudsql-docker/gce-proxy:1.16 /cloud_sql_proxy \
    -instances=mvp-api-254102:us-central1:mvp-api=tcp:0.0.0.0:5432 -credential_file=/config

Unfortunately Docker complains:

invalid json file "/config": read /config: is a directory

This seems to be such a simple thing to do yet I can't figure it out. Any clues?

This is the correct form:

docker run -d \
    -v /Users/<user>/Code/mvp/mvp-server/scripts/credentials:/config \
    -p 127.0.0.1:5432:5432 \
    gcr.io/cloudsql-docker/gce-proxy:1.16 /cloud_sql_proxy \
    -instances=mvp-api-254102:us-central1:mvp-api=tcp:0.0.0.0:5432 -credential_file=/config/ssh-master-account-key.json

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM