Answers: <p>The number of downvotes on the link that is mentioned in the question could indicate that there are issues with the instructions.</p>
  
  <p>Perhaps one could use native commands to backup the database. For example, <a href="https://stackoverflow.com/questions/39210274/how-do-i-backup-a-database-in-docker">this answer</a> shows how to backup a postgres database that runs in docker using the pg_dump command.</p>
  
Answers: CC BY-SA 3.0
Answers: 2017-10-29T13:40:47.237Z
Answers: 2017-10-29T13:40:47.237Z
Answers: 030
Body: <p>According to <a href="https://docs.docker.com/compose/extends/#understanding-multiple-compose-files" rel="nofollow noreferrer">this documentation</a> one could create a database backup</p>
  
  <p>docker-compose.admin.yml</p>
  
  <pre><code>version: '3'
  services:
    dbadmin:
      build: db_data/
      links:
        - db
  </code></pre>
  
  <p>running</p>
  
  <pre><code>docker-compose -f docker-compose.yml -f docker-compose.admin.yml \
  run dbadmin db-backup
  </code></pre>
  
  <p>results initially in:</p>
  
  <pre><code>ERROR: Error processing tar file(archive/tar: invalid tar header): 
  </code></pre>
  
  <p>and when it is run for the second time:</p>
  
  <pre><code>ERROR: Error processing tar file(exit status 1): unexpected EOF
  </code></pre>
  
Tags: <docker-compose>
Title: How to create a database backup using docker-compose
UserDisplayName: 030
ThreadText: # How to create a database backup using docker-compose
  
  (Asked by: username_0 on 2017-05-12)
  
  According to [this documentation](https://docs.docker.com/compose/extends/#understanding-multiple-compose-files) one could create a database backup
  
  docker-compose.admin.yml
  
  ```
  version: '3'
  services:
    dbadmin:
      build: db_data/
      links:
        - db
  
  ```
  
  running
  
  ```
  docker-compose -f docker-compose.yml -f docker-compose.admin.yml \
  run dbadmin db-backup
  
  ```
  
  results initially in:
  
  ```
  ERROR: Error processing tar file(archive/tar: invalid tar header): 
  
  ```
  
  and when it is run for the second time:
  
  ```
  ERROR: Error processing tar file(exit status 1): unexpected EOF
  
  ```
  
  **Tags:** docker-compose
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-10-29. Score: 0 | Accepted answer
  
  The number of downvotes on the link that is mentioned in the question could indicate that there are issues with the instructions.
  
  Perhaps one could use native commands to backup the database. For example, [this answer](https://stackoverflow.com/questions/39210274/how-do-i-backup-a-database-in-docker) shows how to backup a postgres database that runs in docker using the pg\_dump command.
  
  
  ---
  
  