mirror of
https://github.com/neondatabase/neon.git
synced 2025-12-27 16:12:56 +00:00
* Add the REPOSITORY env to build args to avoid the following error when executing without the credentials for the repository. ``` ERROR: Service 'compute' failed to build: Head "https://369495373322.dkr.ecr.eu-central-1.amazonaws.com/v2/compute-node-v15/manifests/2221": no basic auth credentials ``` * update the tag version in the documentation to support storage broker
3.5 KiB
3.5 KiB
Docker images of Neon
Images
Currently we build two main images:
- neondatabase/neon — image with pre-built
pageserver,safekeeperandproxybinaries and all the required runtime dependencies. Built from /Dockerfile. - neondatabase/compute-node — compute node image with pre-built Postgres binaries from neondatabase/postgres.
And additional intermediate image:
- neondatabase/compute-tools — compute node configuration management tools.
Building pipeline
We build all images after a successful release tests run and push automatically to Docker Hub with two parallel CI jobs
-
neondatabase/compute-toolsandneondatabase/compute-node -
neondatabase/neon
Docker Compose example
You can see a docker compose example to create a neon cluster in /docker-compose/docker-compose.yml. It creates the following conatainers.
- pageserver x 1
- safekeeper x 3
- storage_broker x 1
- compute x 1
- MinIO x 1 # This is Amazon S3 compatible object storage
How to use
- create containers
You can specify version of neon cluster using following environment values.
- PG_VERSION: postgres version for compute (default is 14)
- TAG: the tag version of docker image (default is latest), which is tagged in CI test
$ cd docker-compose/
$ docker-compose down # remove the conainers if exists
$ PG_VERSION=15 TAG=2937 docker-compose up --build -d # You can specify the postgres and image version
Creating network "dockercompose_default" with the default driver
Creating docker-compose_storage_broker_1 ... done
(...omit...)
- connect compute node
$ echo "localhost:55433:postgres:cloud_admin:cloud_admin" >> ~/.pgpass
$ psql -h localhost -p 55433 -U cloud_admin
postgres=# CREATE TABLE t(key int primary key, value text);
CREATE TABLE
postgres=# insert into t values(1,1);
INSERT 0 1
postgres=# select * from t;
key | value
-----+-------
1 | 1
(1 row)
- If you want to see the log, you can use
docker-compose logscommand.
# check the container name you want to see
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d6968a5ae912 dockercompose_compute "/shell/compute.sh" 5 minutes ago Up 5 minutes 0.0.0.0:3080->3080/tcp, 0.0.0.0:55433->55433/tcp dockercompose_compute_1
(...omit...)
$ docker logs -f dockercompose_compute_1
2022-10-21 06:15:48.757 GMT [56] LOG: connection authorized: user=cloud_admin database=postgres application_name=psql
2022-10-21 06:17:00.307 GMT [56] LOG: [NEON_SMGR] libpagestore: connected to 'host=pageserver port=6400'
(...omit...)
- If you want to see durable data in MinIO which is s3 compatible storage
Access http://localhost:9001 and sign in.
- Username:
minio - Password:
password
You can see durable pages and WAL data in neon bucket.