Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ gitlab.com/gitlab-org/gitlab-foss/blob/master/CHANGELOG.md) for the list of chan

## 19.0.0

**Important note:** In GitLab 19.0 and later, [PostgreSQL 17 is the minimum supported version](https://docs.gitlab.com/releases/19/gitlab-19-0-released/#postgresql-17-minimum-requirement).

- gitlab: upgrade CE to v19.0.0
- gitaly: upgrade to v19.0.0
- gitlab-pages: upgrade to v19.0.0
- gitlab-shell: upgrade to v14.51.0
- rubygems: upgrade to v4.0.12
- postgresql: upgrade to postgresql 17

## 18.11.3

Expand Down
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ ENV GITLAB_VERSION=${VERSION} \
GITLAB_CACHE_DIR="/etc/docker-gitlab" \
RAILS_ENV=production \
NODE_ENV=production \
NO_SOURCEMAPS=true
NO_SOURCEMAPS=true \
# v19.x : minimum = 17.0, maximum = 17.x (currently 17.10, is 170010)
POSTGRESQL_SERVER_REQUIRED_VERSION_MINIMUM=170000 \
POSTGRESQL_SERVER_TESTED_VERSION_MAXIMUM=170010

ENV GITLAB_INSTALL_DIR="${GITLAB_HOME}/gitlab" \
GITLAB_SHELL_INSTALL_DIR="${GITLAB_HOME}/gitlab-shell" \
Expand Down Expand Up @@ -50,7 +53,7 @@ RUN set -ex && \
sudo supervisor logrotate locales curl \
meson \
nginx openssh-server redis-tools \
postgresql-client-13 postgresql-client-14 postgresql-client-15 postgresql-client-16 postgresql-client-17 \
postgresql-client-17 postgresql-client-18 \
python3 python3-docutils nodejs yarn gettext-base graphicsmagick \
libpq5 zlib1g libyaml-dev libssl-dev libgdbm-dev libre2-dev \
libreadline-dev libncurses5-dev libffi-dev curl openssh-server libxml2-dev libxslt-dev \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ quickstart:
@docker run --name=gitlab-postgresql -d \
--env='DB_NAME=gitlabhq_production' \
--env='DB_USER=gitlab' --env='DB_PASS=password' \
sameersbn/postgresql:latest
kkimurak/sameersbn-postgresql:17
@echo "Starting redis container..."
@docker run --name=gitlab-redis -d \
sameersbn/redis:latest
Expand Down
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ docker run --name gitlab-postgresql -d \
--env 'DB_USER=gitlab' --env 'DB_PASS=password' \
--env 'DB_EXTENSION=pg_trgm,btree_gist' \
--volume /srv/docker/gitlab/postgresql:/var/lib/postgresql \
kkimurak/sameersbn-postgresql:16
kkimurak/sameersbn-postgresql:17
```

Step 2. Launch a redis container
Expand Down Expand Up @@ -276,18 +276,16 @@ Configuring gitlab::database

Please note furthermore, that only compatible versions of the `postgresql-client` to GitLab are shipped with this image. Currently, these belong to

- `postgresql-client-13`,
- `postgresql-client-14`,
- `postgresql-client-15`,
- `postgresql-client-16`,
- and `postgresql-client-17`.
- `postgresql-client-17` and
- `postgresql-client-18` (not officially supported).

***Notes:***

- GitLab CE version 13.7.0 and later requires PostgreSQL version 12.x.
- GitLab CE version 16.0.0 and later requires PostgreSQL version 13.x.
- GitLab CE version 17.0.0 and later requires PostgreSQL version 14.x.
- GitLab CE version 18.0.0 and later requires PostgreSQL version 16.x.
- GitLab CE version 19.0.0 and later requires PostgreSQL version 17.x.

##### External PostgreSQL Server

Expand Down Expand Up @@ -325,7 +323,7 @@ To illustrate linking with a postgresql container, we will use the [sameersbn/po
First, let's pull the postgresql image from the docker index.

```bash
docker pull kkimurak/sameersbn-postgresql:16
docker pull kkimurak/sameersbn-postgresql:17
```

For data persistence lets create a store for the postgresql and start the container.
Expand All @@ -345,7 +343,7 @@ docker run --name gitlab-postgresql -d \
--env 'DB_USER=gitlab' --env 'DB_PASS=password' \
--env 'DB_EXTENSION=pg_trgm' \
--volume /srv/docker/gitlab/postgresql:/var/lib/postgresql \
kkimurak/sameersbn-postgresql:16
kkimurak/sameersbn-postgresql:17
```

The above command will create a database named `gitlabhq_production` and also create a user named `gitlab` with the password `password` with access to the `gitlabhq_production` database.
Expand Down Expand Up @@ -2843,6 +2841,7 @@ Usage when using `docker-compose` can also be found there.
> - As of version 16.0.0, the required PostgreSQL version is 13.x.
> - As of version 17.0.0, the required PostgreSQL version is 14.x.
> - As of version 18.0.0, the required PostgreSQL version is 16.x.
> - As of version 19.0.0, the required PostgreSQL version is 17.x.
>
> If you're using PostgreSQL image other than the above, please review section [Upgrading PostgreSQL](#upgrading-postgresql).

Expand Down
27 changes: 26 additions & 1 deletion assets/runtime/functions
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,38 @@ gitlab_generate_postgresqlrc() {

echo "- Detected server version: ${DB_SERVER_VERSION}"

# remove leading zero (prior to 10.x it was like "090605" so that cannot treated as number)
DB_SERVER_VERSION="${DB_SERVER_VERSION#0}"

# Anyway, we can get major version (8, 9, 10 and so on) by dividing by 10000.
# DB_SERVER_VERSION_MAJOR=${DB_SERVER_VERSION%%.*}
DB_SERVER_VERSION_MAJOR=$((DB_SERVER_VERSION/10000))
DB_CLIENT_VERSION_PACKAGE_NAME=

# Check version requirement
if [[ "${DB_SERVER_VERSION}" -lt "${POSTGRESQL_SERVER_REQUIRED_VERSION_MINIMUM}" ]]; then
echo " ERROR: Version requirement mismatch for your PostgreSQL server!"
echo
echo " Consider upgrading your PostgreSQL server before running this or later versions"
echo " of this image."
echo
echo " Minimal required version is: ${POSTGRESQL_SERVER_REQUIRED_VERSION_MINIMUM}"
echo " Your provided version is : ${DB_SERVER_VERSION}"
echo
echo " Aborting..."
return 1
fi

if [[ "${DB_SERVER_VERSION}" -gt "${POSTGRESQL_SERVER_TESTED_VERSION_MAXIMUM}" ]]; then
echo " WARNING: Version requirement mismatch for your PostgreSQL server!"
echo
echo " Maximal tested version is: ${POSTGRESQL_SERVER_TESTED_VERSION_MAXIMUM}"
echo " Your provided version is : ${DB_SERVER_VERSION}"
echo
fi

if [[ "${DB_SERVER_VERSION_MAJOR}" -ge 10 ]]; then
# v10 or later: use "rought major version" as version number in package name
# v10 or later: use "rough major version" as version number in package name
DB_CLIENT_VERSION_PACKAGE_NAME=${DB_SERVER_VERSION_MAJOR}
else
# prior to v10: convert
Expand Down
2 changes: 1 addition & 1 deletion contrib/docker-swarm/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:

postgresql:
restart: always
image: kkimurak/sameersbn-postgresql:16
image: kkimurak/sameersbn-postgresql:17
volumes:
- /srv/docker/gitlab/postgresql:/var/lib/postgresql:Z
environment:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.swarm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
- node.labels.gitlab.redis-data == true

postgresql:
image: kkimurak/sameersbn-postgresql:16
image: kkimurak/sameersbn-postgresql:17
volumes:
- postgresql-data:/var/lib/postgresql:Z
environment:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:

postgresql:
restart: always
image: kkimurak/sameersbn-postgresql:16
image: kkimurak/sameersbn-postgresql:17
volumes:
- postgresql-data:/var/lib/postgresql:Z
environment:
Expand Down
2 changes: 1 addition & 1 deletion docs/docker-compose-keycloak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:

postgresql:
restart: always
image: kkimurak/sameersbn-postgresql:16
image: kkimurak/sameersbn-postgresql:17
volumes:
- postgresql-data:/var/lib/postgresql:Z
environment:
Expand Down
2 changes: 1 addition & 1 deletion docs/docker-compose-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:

postgresql:
restart: always
image: kkimurak/sameersbn-postgresql:16
image: kkimurak/sameersbn-postgresql:17
volumes:
- postgresql:/var/lib/postgresql:Z
environment:
Expand Down
2 changes: 1 addition & 1 deletion docs/s3_compatible_storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ services:

postgresql:
restart: always
image: sameersbn/postgresql:10-2
image: kkimurak/sameersbn-postgresql:17
volumes:
- /tmp/docker/gitlab/postgresql:/var/lib/postgresql:Z
environment:
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/postgresql-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
spec:
containers:
- name: postgresql
image: kkimurak/sameersbn-postgresql:16
image: kkimurak/sameersbn-postgresql:17
env:
- name: DB_USER
value: gitlab
Expand Down