question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pg_dump: not found - for cli container to connect to postgresql

See original GitHub issue

It seems that pg_dump is missing on the cli container

[xxx]cli-drupal:/app/web$ drush sql-sync @self @xxxx -y
You will destroy data in api-lagoon-master.lagoon.ch.amazee.io/drupal and replace with data from drupal.
Do you really want to continue? (y/n): y
Starting to dump database on Source.                                                                                                                                                                                           [ok]
sh: pg_dump: not found
Database dump saved to /home/drush-backups/drupal/20180222134406/xxx.sql.gz                                                                                                                            [success]
Starting to discover temporary files directory on Destination.                                                                                                                                                                 [ok]
You will delete files in xxx-xxxx@api-lagoon-master.lagoon.ch.amazee.io:/tmp/xxx.sql.gz and replace with data from /home/drush-backups/drupal/20180222134406/xxx.sql.gz
Do you really want to continue? (y/n): y
Copying dump file from Source to Destination.                                                                                                                                                                                  [ok]
Starting to import dump file onto Destination database.  

As a workaround this can be fixed by adding following line to Dockerfile.cli

RUN apk add --no-cache postgresql

It seems that pg_dump is not existing in a seperate package https://stackoverflow.com/questions/40628472/can-i-install-pg-dump-without-installing-postgres-on-alpine

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
rackbergcommented, Feb 22, 2018

We’re trying to multistage the amazeeio/postgres-drupal image inside our Dockerfile.cli and to copy the pg_dump from there.

FROM amazeeio/postgres-drupal:latest as amazeeio-postgres

FROM amazeeio/php:7.1-cli-drupal

# copy the pg_dump binary
COPY --from=amazeeio-postgres /usr/local/bin/pg_dump /usr/local/bin/pg_dump
0reactions
dasrechtcommented, Feb 22, 2018

Ok as discussed during standup we’ll install the edge version of postgresql-client

Read more comments on GitHub >

github_iconTop Results From Across the Web

pg_dump: not found - for cli container to connect to postgresql
It seems that pg_dump is missing on the cli container [xxx]cli-drupal:/app/web$ drush sql-sync @self @xxxx -y You will destroy data in ...
Read more >
Laravel Squash Migrate Error pg_dump not found
What solved it for me was an installation of mysql-client inside the container in which I was trying to execute php artisan schema:dump...
Read more >
How to dump & restore a PostgreSQL database from a docker ...
This quickie assumes you have nothing directly installed on your development machine, so everything is run straight from and to the Docker ...
Read more >
Documentation: 15: 26.1. SQL Dump - PostgreSQL
pg_dump is a regular PostgreSQL client application (albeit a particularly clever one). This means that you can perform this backup procedure from any...
Read more >
Configuring Databases - CircleCI
The service image gives access to additional services like databases. ... For example, your PostgreSQL container might be running, but might not be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found