Skip to content

Commit

Permalink
DISTPG-521 Updated the Connect from another app section
Browse files Browse the repository at this point in the history
The --link option is deprecated. Moreover, using it throws errors. Updated the section to use the --network option
  • Loading branch information
nastena1606 committed Jan 31, 2023
1 parent 762240b commit 9baccc4
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 14 deletions.
10 changes: 7 additions & 3 deletions percona-distribution-postgresql-11/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,19 @@ See the list above for relevant tags, or look at the [full list of tags](https:/

## Connect to Percona Distribution for PostgreSQL from an Application in Another Docker Container

This image exposes the standard PostgreSQL port (5432), so container linking makes the instance available to other containers. Start other containers like this in order to link it to the Percona Distribution for PostgreSQL container:
This image exposes the standard PostgreSQL port (5432), so container linking makes the instance available to other containers.

docker run --name app-container-name --link container-name -d app-that-uses-postgresql
Start other containers like this in order to link it to the Percona Distribution for PostgreSQL container:

docker run --rm -it --name app-container-name --network container:container-name -d app-that-uses-postgresql

where `app-container-name` is the name of the container where your application is running, `container name` is the name of your Percona Distribution for PostgreSQL container and `app-that-uses-postgresql` is the name of your PostgreSQL client.

## Connect to Percona Distribution for PostgreSQL from the PSQL Command Line Client

The following command starts another container instance and runs the `psql` command line client against your original container, allowing you to execute SQL statements against your database:

docker run -it --link container-name --rm perconalab/percona-distribution-postgresql:tag psql -h container-name -U user-name
docker run -it --network container:container-name --rm perconalab/percona-distribution-postgresql:tag psql -h container-name -U user-name

where `container-name` is the name of your database container.

Expand Down
10 changes: 7 additions & 3 deletions percona-distribution-postgresql-12/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,19 @@ See the list above for relevant tags, or look at the [full list of tags](https:/

## Connect to Percona Distribution for PostgreSQL from an Application in Another Docker Container

This image exposes the standard PostgreSQL port (5432), so container linking makes the instance available to other containers. Start other containers like this in order to link it to the Percona Distribution for PostgreSQL container:
This image exposes the standard PostgreSQL port (5432), so container linking makes the instance available to other containers.

docker run --name app-container-name --link container-name -d app-that-uses-postgresql
Start other containers like this in order to link it to the Percona Distribution for PostgreSQL container:

docker run --rm -it --name app-container-name --network container:container-name -d app-that-uses-postgresql

where `app-container-name` is the name of the container where your application is running, `container name` is the name of your Percona Distribution for PostgreSQL container and `app-that-uses-postgresql` is the name of your PostgreSQL client.

## Connect to Percona Distribution for PostgreSQL from the PSQL Command Line Client

The following command starts another container instance and runs the `psql` command line client against your original container, allowing you to execute SQL statements against your database:

docker run -it --link container-name --rm perconalab/percona-distribution-postgresql:tag psql -h container-name -U user-name
docker run -it --network container:container-name --rm perconalab/percona-distribution-postgresql:tag psql -h container-name -U user-name

where `container-name` is the name of your database container.

Expand Down
7 changes: 5 additions & 2 deletions percona-distribution-postgresql-13/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,20 @@ See the list above for relevant tags, or look at the [full list of tags](https:/

This image exposes the standard PostgreSQL port (5432), so container linking makes the instance available to other containers. Start other containers like this in order to link it to the Percona Distribution for PostgreSQL container:

docker run --name app-container-name --link container-name -d app-that-uses-postgresql
docker run --rm -it --name app-container-name --network container:container-name -d app-that-uses-postgresql

where `app-container-name` is the name of the container where your application is running, `container name` is the name of your Percona Distribution for PostgreSQL container and `app-that-uses-postgresql` is the name of your PostgreSQL client.

## Connect to Percona Distribution for PostgreSQL from the PSQL Command Line Client

The following command starts another container instance and runs the `psql` command line client against your original container, allowing you to execute SQL statements against your database:

docker run -it --link container-name --rm perconalab/percona-distribution-postgresql:tag psql -h container-name -U user-name
docker run -it --network container:container-name --rm perconalab/percona-distribution-postgresql:tag psql -h container-name -U user-name

where `container-name` is the name of your database container.



# Notes, Tips, Gotchas

## Where to Store Data
Expand Down
13 changes: 9 additions & 4 deletions percona-distribution-postgresql-14/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,30 @@ Images are updated when new releases are published.

Start a Percona Distribution for PostgreSQL container as follows:

docker run --name container-name -e POSTGRESQL-PASSWORD=secret -d perconalab/percona-distribution-postgresql:tag
docker run --name container-name -e POSTGRES_PASSWORD=secret -d perconalab/percona-distribution-postgresql:tag

Where `container-name` is the name you want to assign to your container and `tag` is the tag specifying the version you want. See the list above for relevant tags, or look at the [full list of tags](https://hub.docker.com/r/perconalab/percona-distribution-postgresql/tags/).

## Connect to Percona Distribution for PostgreSQL from an Application in Another Docker Container

This image exposes the standard PostgreSQL port (5432), so container linking makes the instance available to other containers. Start other containers like this in order to link it to the Percona Distribution for PostgreSQL container:
This image exposes the standard PostgreSQL port (5432), so container linking makes the instance available to other containers.

docker run --name app-container-name --link container-name -d app-that-uses-postgresql
Start other containers like this in order to link it to the Percona Distribution for PostgreSQL container:

docker run --rm -it --name app-container-name --network container:container-name -d app-that-uses-postgresql

where `app-container-name` is the name of the container where your application is running, `container name` is the name of your Percona Distribution for PostgreSQL container and `app-that-uses-postgresql` is the name of your PostgreSQL client.

## Connect to Percona Distribution for PostgreSQL from the PSQL Command Line Client

The following command starts another container instance and runs the `psql` command line client against your original container, allowing you to execute SQL statements against your database:

docker run -it --link container-name --rm perconalab/percona-distribution-postgresql:tag psql -h container-name -U user-name
docker run -it --network container:container-name --rm perconalab/percona-distribution-postgresql:tag psql -h container-name -U user-name

where `container-name` is the name of your database container.



# Notes, Tips, Gotchas

## Where to Store Data
Expand Down
6 changes: 4 additions & 2 deletions percona-distribution-postgresql-15/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ See the list above for relevant tags, or look at the [full list of tags](https:/

This image exposes the standard PostgreSQL port (5432), so container linking makes the instance available to other containers. Start other containers like this in order to link it to the Percona Distribution for PostgreSQL container:

docker run --name app-container-name --link container-name -d app-that-uses-postgresql
docker run --rm -it --name app-container-name --network container:container-name -d app-that-uses-postgresql

where `app-container-name` is the name of the container where your application is running, `container name` is the name of your Percona Distribution for PostgreSQL container and `app-that-uses-postgresql` is the name of your PostgreSQL client.

## Connect to Percona Distribution for PostgreSQL from the PSQL Command Line Client

The following command starts another container instance and runs the `psql` command line client against your original container, allowing you to execute SQL statements against your database:

docker run -it --link container-name --rm perconalab/percona-distribution-postgresql:tag psql -h container-name -U user-name
docker run -it --network container:container-name --rm perconalab/percona-distribution-postgresql:tag psql -h container-name -U user-name

where `container-name` is the name of your database container.

Expand Down

0 comments on commit 9baccc4

Please sign in to comment.