Backup a MySQL database from within a Docker container

Simple command to backup a MySQL database from within a Docker container

sudo docker exec -i <CONTAINER_ID> mysqldump -u <DATABASE_USERNAME> -p --databases <DATABASE_NAME> > yourbackup.sql