1

ubuntu ホスト マシンに docker rootless をインストールしました。最も重要な部分が次のようになっている timescaledb を構築するための Dockerfile があります。

# Install the tools we need for installation
RUN  apt-get update && apt-get -y install gnupg2 lsb-release wget
# Add Postgres and Timescale package repository
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -c -s)-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN sh -c "echo 'deb https://packagecloud.io/timescale/timescaledb/debian/ `lsb_release -c -s` main' > /etc/apt/sources.list.d/timescaledb.list"
RUN wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | apt-key add -
# Install Timescale
RUN apt-get update && apt-get -y install timescaledb-2-postgresql-12=2.0.0-zz~debian10

対応する docker-compose ファイルは次のようになります。

  timescale:
    tty: true
    volumes:
      - timescale-volume:/var/lib/postgresql/data:rw
    build:
      context: ./timescale
      dockerfile: Dockerfile
    command:
      - /bin/bash
    depends_on:
      - cert-mounter

docker-compose upsudo で実行すると正常に動作し、イメージがビルドされ、コンテナーが実行されます。ルートレスで実行すると、次のエラーが発生します。

dpkg: error processing package postgresql-12 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of timescaledb-2-postgresql-12:
 timescaledb-2-postgresql-12 depends on postgresql-12; however:
  Package postgresql-12 is not configured yet.

dpkg: error processing package timescaledb-2-postgresql-12 (--configure):
 dependency problems - leaving unconfigured
Setting up exim4-daemon-light (4.92-8+deb10u5) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of start.
Initializing GnuTLS DH parameter file
Setting up libmailutils5:amd64 (1:3.5-4) ...
Setting up mailutils (1:3.5-4) ...
update-alternatives: using /usr/bin/frm.mailutils to provide /usr/bin/frm (frm) in auto mode
update-alternatives: using /usr/bin/from.mailutils to provide /usr/bin/from (from) in auto mode
update-alternatives: using /usr/bin/messages.mailutils to provide /usr/bin/messages (messages) in auto mode
update-alternatives: using /usr/bin/movemail.mailutils to provide /usr/bin/movemail (movemail) in auto mode
update-alternatives: using /usr/bin/readmsg.mailutils to provide /usr/bin/readmsg (readmsg) in auto mode
update-alternatives: using /usr/bin/dotlock.mailutils to provide /usr/bin/dotlock (dotlock) in auto mode
update-alternatives: using /usr/bin/mail.mailutils to provide /usr/bin/mailx (mailx) in auto mode
dpkg: dependency problems prevent configuration of timescaledb-2-loader-postgresql-12:
 timescaledb-2-loader-postgresql-12 depends on postgresql-12; however:
  Package postgresql-12 is not configured yet.

dpkg: error processing package timescaledb-2-loader-postgresql-12 (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.28-10) ...
Processing triggers for mime-support (3.62) ...
Errors were encountered while processing:
 postgresql-common
 postgresql-12
 timescaledb-2-postgresql-12
 timescaledb-2-loader-postgresql-12
E: Sub-process /usr/bin/dpkg returned an error code (1)
The command '/bin/sh -c apt-get update && apt-get -y install timescaledb-2-postgresql-12=2.0.0-zz~debian10' returned a non-zero code: 100
ERROR: Service 'timescale' failed to build

何が問題なのですか?他のコンテナはどうにか構築され、問題なくルートレスで実行されます...

4

1 に答える 1