Files
neon/docs/docker.md
Heikki Linnakangas 0a256148b0 Update documentation on running locally with Docker (#8020)
- Fix the dockerhub URLs

- `neondatabase/compute-node` image has been replaced with Postgres
version specific images like `neondatabase/compute-node-v16`

- Use TAG=latest in the example, rather than some old tag. That's a
sensible default for people to copy-past

- For convenience, use a Postgres connection URL in the `psql` example
that also includes the password. That way, there's no need to set up
.pgpass

- Update the image names in `docker ps` example to match what you get
when you follow the example
2024-06-12 07:06:00 +00:00

3.5 KiB

Docker images of Neon

Images

Currently we build two main images:

And additional intermediate image:

Build pipeline

We build all images after a successful release tests run and push automatically to Docker Hub with two parallel CI jobs

  1. neondatabase/compute-tools and neondatabase/compute-node-v16 (and -v15 and -v14)

  2. 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 containers.

  • 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

  1. create containers

You can specify version of neon cluster using following environment values.

  • PG_VERSION: postgres version for compute (default is 16 as of this writing)
  • TAG: the tag version of docker image, which is tagged in CI test. Default is 'latest'
$ cd docker-compose/
$ docker-compose down   # remove the containers if exists
$ PG_VERSION=16 TAG=latest 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...)
  1. connect compute node
$ psql postgresql://cloud_admin:cloud_admin@localhost:55433/postgres
psql (16.3)
Type "help" for help.

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)

  1. If you want to see the log, you can use docker-compose logs command.
# check the container name you want to see
$ docker ps
CONTAINER ID   IMAGE                                              COMMAND                  CREATED         STATUS         PORTS                                                                                      NAMES
3582f6d76227   docker-compose_compute                             "/shell/compute.sh"      2 minutes ago   Up 2 minutes   0.0.0.0:3080->3080/tcp, :::3080->3080/tcp, 0.0.0.0:55433->55433/tcp, :::55433->55433/tcp   docker-compose_compute_1
(...omit...)

$ docker logs -f docker-compose_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...)
  1. 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.