• @craig-gomes some improvement suggestions:

    • Link to Mockaroo.com
    • Suggest checking "include CREATE TABLE" and Format: SQL.
    Edited by Daniel Diniz
  • Craig Gomes @craig-gomes ·

    Done, good suggestions @dnldnz

  • For the upcoming training, we will be using PostgreSQL 13:

    docker run --name postgres_training -e POSTGRES_PASSWORD=mysecretpassword -d postgres:13

  • If you want to follow the postgres installation process, you can instead create a container running ubuntu:

    docker run --name pg_training -t -d ubuntu:20.04
    docker exec -it pg_training /bin/bash

    Inside the container you'll need to install the following additional packages:

    apt install -y lsb-release wget sudo gnupg
  • when using the postgres_training image, in order to have utility applications installed, you can do the following:

    apt update && apt install lsb-core procps

    When using postgres:13 image install lsb-release isntead:

    apt update && apt install lsb-release procps
    Edited by Gabriel Mazetto
  • I also found out that using docker composer is easier when just playing with queries index etc... here is my "just works" version:

    docker-compose.yml

    version: "3.9"
    services:
      pgtraining:
        build: .
        environment:
          POSTGRES_PASSWORD: mysecretpassword
        volumes:
          - pgdata:/var/lib/postgresql/data
      psql:
        build: .
        environment:
          PGPASSWORD: mysecretpassword
        command: psql -h pgtraining -U postgres
    volumes:
      pgdata:

    Dockerfile

    FROM postgres:13
    RUN apt update && \
        apt install -y lsb-release procps && \
        apt-get clean && rm -f /var/lib/apt/lists/*_*

    boot up the database:

    docker-compose up -d

    connect to the database:

    docker-compose run psql

    tear down:

    docker-compose down
  • Installing debugging symbols with the docker image:

    apt-get update
    apt-get install postgresql-13-dbgsym
    apt-get install postgresql-client-13-dbgsym
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment