Skip to content

Commit 9009045

Browse files
committed
Update README to handle Docker host connection for different setups
- Added instructions for setting DOCKER_HOST variable to host.docker.internal when using Docker Desktop. - Removed unnecessary defining Signed-off-by: sinadarbouy <sinadarbouy@gmail.com>
1 parent 45958a6 commit 9009045

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

getting-started/running-gatewayd.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ docker run --rm --name postgres-test -p 5432:5432 -e POSTGRES_PASSWORD=postgres
3232
Test your database by running the following command:
3333

3434
```bash
35-
DOCKER_HOST=$(ip addr show docker0 | grep inet | grep -v inet6 | awk -F' ' '{ print $2 }' | sed 's/\/16//g')
35+
DOCKER_HOST=$(if ip addr show docker0 > /dev/null 2>&1; then ip addr show docker0 | grep inet | grep -v inet6 | awk -F' ' '{ print $2 }' | sed 's/\/.*//'; else echo "host.docker.internal"; fi);
3636
docker exec -it postgres-test psql postgresql://postgres:postgres@${DOCKER_HOST}:5432/postgres -c "\d"
3737
```
3838

@@ -120,7 +120,6 @@ Running GatewayD will produce the following log output, which means that Gateway
120120
GatewayD is running on the host, while PostgreSQL is running inside a container. You can run the following command to test it. Notice that `${DOCKER_HOST}` holds the IP address of the host machine, that is accessible from inside the container.
121121

122122
```bash
123-
DOCKER_HOST=$(ip addr show docker0 | grep inet | grep -v inet6 | awk -F' ' '{ print $2 }' | sed 's/\/16//g')
124123
docker exec -it postgres-test psql postgresql://postgres:postgres@${DOCKER_HOST}:15432/postgres
125124
```
126125

0 commit comments

Comments
 (0)