Skip to content

Commit 04cb2cf

Browse files
author
Jeff Chen
committed
tests: fix docker run command in config
1 parent 9a23a02 commit 04cb2cf

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ workflows:
2929
IMAGES=$(docker images --format='{{.Repository}}:{{.Tag}}' | grep "ccitest/postgres")
3030
for IMAGE in $IMAGES; do
3131
printf "Booting $IMAGE...\n"
32-
CONTAINER_ID=$(docker run --rm --env POSTGRES_USER=user --env POSTGRES_PASSWORD=passw0rd -p 5432:5432 -c 'config_file=/etc/postgresql/postgresql.conf' -d $IMAGE)
32+
CONTAINER_ID=$(docker run --rm --env POSTGRES_USER=user --env POSTGRES_PASSWORD=passw0rd -p 5432:5432 -d $IMAGE postgres -c 'config_file=/etc/postgresql/postgresql.conf')
3333
for i in {1..20}; do
3434
printf "[$i/20] Checking Postgres is up...\n"
3535
pg_isready -h 127.0.0.1

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,12 @@ When releasing proper images for CircleCI, this script is run from a CircleCI pi
156156
Because some configurations for postgres are enabled at runtime, it is difficult if not impossible to change certain settings.
157157
As a result, we've provided a configuration file within this repository that allows you to import certain properties that can support your use case. This is located at the project root under `postgres.conf`, however, you would be able to supply a custom configuration file yourself. In doing so, you would also need to specify this file when running the docker container.
158158

159-
For example, in the `.circleci/config.yml`, we are using it with this command; specifically, the "-c 'config_file=xxx'" addition. `docker run --rm --env POSTGRES_USER=user --env POSTGRES_PASSWORD=passw0rd -p 5432:5432 -c 'config_file="/etc/postgresql/postgresql.conf' -d $IMAGE`
159+
For example, in the `.circleci/config.yml`, we are using it with this command; specifically, the "postgres -c 'config_file=xxx'" addition.
160+
161+
```bash
162+
docker run --rm --env POSTGRES_USER=user --env POSTGRES_PASSWORD=passw0rd -p 5432:5432 -d $IMAGE postgres -c 'config_file=/etc/postgresql/postgresql.conf'
163+
```
164+
160165

161166
For additional resources on how to configure, you would be able to visit [this link](https://github.com/docker-library/docs/blob/master/postgres/README.md#database-configuration) for additional details.
162167

0 commit comments

Comments
 (0)