Backup gitea container

Gitea is great when you want a fast, light and yet user-friendly git repositories. Alternatives would be Gogs, Gitlab or even Github.

Gitea documentation tells you to use docker exec to perform a backup. However, this prevents you from using an additional volume to dump the backup into.

Instead, I prefer to use a similar command using docker run. Assuming the following:

  • the container network is called gitea_default, you only need this if you use an external database such as MySQL
  • the container is called gitea
  • the backup directory is in the current directory and named backups
docker run --rm -it --network gitea_default --volumes-from gitea --volume $(pwd)/backups:/backups --user git --workdir /backups --entrypoint '/app/gitea/gitea' gitea/gitea:1.15.10 dump -c /data/gitea/conf/app.ini

This entry was posted in Computer, Linux and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.