DirectorySecurity AdvisoriesPricing
Sign In
Directory
cloud-sql-proxy logo

cloud-sql-proxy

Last changed

Request a free trial

Contact our team to test out this image for free. Please also indicate any other images you would like to evaluate.

Request trial
Tags
Overview
Comparison
Provenance
Specifications
SBOM
Vulnerabilities
Advisories

Chainguard Container for cloud-sql-proxy

The Cloud SQL Auth Proxy is a utility for ensuring secure connections to Cloud SQL instances.

Chainguard Containers are regularly-updated, secure-by-default container images.

Download this Container Image

For those with access, this container image is available on cgr.dev:

docker pull cgr.dev/ORGANIZATION/cloud-sql-proxy:latest

Be sure to replace the ORGANIZATION placeholder with the name used for your organization's private repository within the Chainguard Registry.

Compatibility Notes

The cgr.dev/chainguard/cloud-sql-proxy image is a minimal build of Google Cloud SQL Auth Proxy. Switching to this image should not require any changes to your existing setup.

Prerequisites

To run this cloud-sql-proxy image, you will need the following:

Getting Started

This cloud-sql-proxy image's ENTRYPOINT is configured to run the proxy directly. The following command shows a basic setup of running the proxy as a standalone Docker container, using a service account key for authentication:

docker run \
    --publish <host-port>:<proxy-port> \
    --mount type=bind,source="$(pwd)"/sa.json,target=/config/sa.json \
    cgr.dev/chainguard/cloud-sql-proxy:latest \
    --address 0.0.0.0 \
    --port <proxy-port> \
    --credentials-file /config/sa.json <instance-connection-name>

In the command above:

  • <host-port>: The port on your host machine that your application will use to connect to the database (e.g., 3306 for MySQL, 5432 for PostgreSQL).
  • <proxy-port>: The port the proxy listens on inside the container.
  • $(pwd)/sa.json: The absolute path to your downloaded service account key file on your host machine.
  • <instance-connection-name>: The connection string for your Cloud SQL instance, formatted as project_id:region:instance_name.

After executing this command, your applications on the host machine can connect to localhost:<host-port> to establish a secure connection to your Cloud SQL instance through the proxy. For example, if your instance is for a postgresql database, you can connect using:

psql -h 127.0.0.1 -p 5432 -U postgres -d postgres

Configuration

The cloud-sql-proxy image supports various configurations via command-line flags.

For instance, to configure the proxy to use Private IP to connect to your Cloud SQL instance, include the --private-ip flag in your command:

docker run \
    --publish <host-port>:<proxy-port> \
    --mount type=bind,source="$(pwd)"/sa.json,target=/config/sa.json \
    cgr.dev/chainguard/cloud-sql-proxy:latest \
    --address 0.0.0.0 \
    --port <proxy-port> \
    --credentials-file /config/sa.json \
    --private-ip <instance-connection-name>

The proxy also provides configurations for using automatic IAM database authentication, Unix domain sockets for local connections, or enabling service account impersonation for flexible access control. Refer to the Cloud SQL Auth Proxy docs for instructions and examples on available configurations.

Documentation and Resources

What are Chainguard Containers?

Chainguard Containers are minimal container images that are secure by default.

In many cases, the Chainguard Containers tagged as :latest contain only an open-source application and its runtime dependencies. These minimal container images typically do not contain a shell or package manager. Chainguard Containers are built with Wolfi, our Linux undistro designed to produce container images that meet the requirements of a more secure software supply chain.

The main features of Chainguard Containers include:

For cases where you need container images with shells and package managers to build or debug, most Chainguard Containers come paired with a -dev variant.

Although the -dev container image variants have similar security features as their more minimal versions, they feature additional software that is typically not necessary in production environments. We recommend using multi-stage builds to leverage the -dev variants, copying application artifacts into a final minimal container that offers a reduced attack surface that won’t allow package installations or logins.

Learn More

To better understand how to work with Chainguard Containers, please visit Chainguard Academy and Chainguard Courses.

In addition to Containers, Chainguard offers VMs and Libraries. Contact Chainguard to access additional products.

Trademarks

This software listing is packaged by Chainguard. The trademarks set forth in this offering are owned by their respective companies, and use of them does not imply any affiliation, sponsorship, or endorsement by such companies.

Licenses

Chainguard container images contain software packages that are direct or transitive dependencies. The following licenses were found in the "latest" tag of this image:

  • Apache-2.0

  • LGPL-2.1-or-later

  • MIT

  • MPL-2.0

For a complete list of licenses, please refer to this Image's SBOM.

Software license agreement

Category
application

Safe Source for Open Sourceâ„¢
Media KitContact Us
© 2025 Chainguard. All Rights Reserved.
Private PolicyTerms of Use

Chainguard ContainersChainguard LibrariesChainguard VMs