Skip to content

Instantly share code, notes, and snippets.

@deevis
Created August 12, 2023 23:17
Show Gist options
  • Save deevis/fa50df908bef0aee2ac898961ca0ebf7 to your computer and use it in GitHub Desktop.
Save deevis/fa50df908bef0aee2ac898961ca0ebf7 to your computer and use it in GitHub Desktop.
Portainer - backup/new docker
# To backup portainer volume
_backup_time=$(date +"%F_%H_%M%P"); sudo tar cvfz /mnt2/docker/backups/portainer/portainer_backup_${_backup_time}.tar.gz /var/lib/docker/volumes/portainer_data
# To run new portainer container with ports and volumes and local docker.sock
docker run -p 8000:8000 -p 9000:9000 --name portainer -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment