1

I want to modify the shared_buffers value of the Postgres service. I am using my own server for the GitLab runner, but am using the public GitLab instance; so I can change the runner configuration, but not the configuration of GitLab itself. As GitLab CI uses the standard upstream Docker postgres service, documented here, it seems like it might be possible to copy shell scripts into /docker-entrypoint-initdb.d and do initialization here. However I can't find any way to access paths inside the container from gitlab-ci.yml.

My question is similar to the following: How to customize the configuration file of the official PostgreSQL docker image? Except that because GitLab CI wraps the Docker initialization in its own interface, the methods shown that use Dockerfile changes can't be obviously translated into a form that works with .gitlab-ci.yml.

Community
  • 1
  • 1
amoe
  • 4,473
  • 4
  • 31
  • 51

1 Answers1

0

Any method based on creating your own image with a customized Dockerfile that uses postgres image as a base can work perfectly fine for you. Simply create a new image and post it to a registry - this can be either the Docker Hub or your own private registry running on the same server as the runner.

In your .gitlab-ci.yml you would then reference that image of yours. In case of Docker Hub:

image: amoe/postgres

...or in case of a private registry on the same host as the runner:

image: localhost:5000/amoe-postgres
tmt
  • 7,611
  • 4
  • 32
  • 46