pg_restore in postgres docker container
<p>I am trying to restore database in PostgreSQL docker container using pg_restore from a shellscript that will be called from docker file. I'm getting following error <strong>&quot;ERROR:  canceling autovacuum task
CONTEXT:  automatic analyze of table 'tablename'&quot;</strong>.</p>
<p><strong>DockerFile:</strong></p>
<pre><code>    FROM postgres:9.3
    ENV POSTGRES_USER postgres
    ENV POSTGRES_PASSWORD Abcd1234
    ENV POSTGRES_DB Clarion1
    COPY DB.backup /var/lib/postgresql/backup/DB.backup
    COPY initialize.sh /docker-entrypoint-initdb.d/initialize.sh
</code></pre>
<p><strong>initialize.sh</strong></p>
<pre><code>    #!/bin/bash
    set -e
    set -x

    echo &quot;******PostgreSQL initialisation******&quot;
    pg_restore -C -d DB /var/lib/postgresql/backup/DB.backup
</code></pre>
<p><strong>Log:</strong></p>
<pre><code>    server started
    CREATE DATABASE
    /docker-entrypoint.sh: running /docker-entrypoint-initdb.d/initialize.sh
    ++ echo '******PostgreSQL initialisation******'
    ++ pg_restore -C -d Clarion1 /var/lib/postgresql/backup/Clarion53.backup
    ******PostgreSQL initialisation******
    ERROR:  canceling autovacuum task
</code></pre>
<p>But if I try to restore DB from command prompt in host machine from same backup file , it is working fine.</p>