dockerdatabase-backupsbarman

Older barman 2.6-1 instead of the latest 2.11 when using 2ndQuadrant Public APT repository


I am trying to setup & deploy barman as a docker container as part of setting up PostgreSQL DR.

I notice that when i use the 2ndQuadrant Public APT repository & install barman i see barman 2.6-1 getting installed instead of 2.11.

Below is my stripped down Dockerfile snippet for the purpose of this sharing.

# Dockerfile

# Barman

FROM debian:buster-slim

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
    apt-utils \
#    ca-certificates \
    curl \
    cron \
    && apt-get update \
    && curl https://dl.2ndquadrant.com/default/release/get/deb | bash \
    && apt-get update \
    && apt-get install -y --no-install-recommends barman \
    && rm -rf /var/lib/apt/lists/*
...
...

When i do the build, i see this,

Selecting previously unselected package barman.
Preparing to unpack .../9-barman_2.6-1_all.deb ...
Unpacking barman (2.6-1) ...
Setting up libexpat1:amd64 (2.2.6-2+deb10u1) ...
Setting up mime-support (3.62) ...
Setting up libsqlite3-0:amd64 (3.27.2-3) ...
Setting up libpq5:amd64 (11.7-0+deb10u1) ...
Setting up readline-common (7.0-5) ...
Setting up libreadline7:amd64 (7.0-5) ...
Setting up libpopt0:amd64 (1.16-12) ...
Setting up libpython2.7-stdlib:amd64 (2.7.16-2+deb10u1) ...
Setting up rsync (3.1.3-6) ...
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of restart.
Setting up python2.7 (2.7.16-2+deb10u1) ...
Setting up libpython2-stdlib:amd64 (2.7.16-1) ...
Setting up python2 (2.7.16-1) ...
Setting up libpython-stdlib:amd64 (2.7.16-1) ...
Setting up python (2.7.16-1) ...
Setting up python-argh (0.26.2-1) ...
Setting up python-argcomplete (1.8.1-1) ...
Setting up python-six (1.12.0-1) ...
Setting up python-psycopg2 (2.7.7-1) ...
Setting up python-dateutil (2.7.3-3) ...
Setting up barman (2.6-1) ...
Processing triggers for libc-bin (2.28-10) ...
...
...

Any pointers on what i am doing wrong here or is the apt repo not updated?

Thanks Muthu


Solution

  • Just to update, it appears to be a problem with the 2ndQuadrant Public APT repository, when i use the PostgreSQL community APT repo i get the latest version picked up & installed.

    For others out there starting out please use this (see below).

    Below is the relevant snippet,

    # Dockerfile
    
    # Barman
    
    FROM debian:buster-slim
    
    RUN apt-get update && apt-get install -y --no-install-recommends wget gnupg2 cron openssh-server && rm -rf /var/lib/apt/lists/*
    RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main" >> /etc/apt/sources.list.d/pgdg.list' \ 
        && (wget --no-check-certificate --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - ) \ 
        && apt-get update && apt-get install -y barman \    
        && rm -rf /var/lib/apt/lists/*
    RUN usermod -a -G sudo barman
    ...
    ...
    ...
    

    Thanks