Backup and restore of a container
- List the container you want to backup (the container must be running)
- Take a snapshot of the running state
- Verify that a snapshot has been stored with your images
- Save as a tar and archive, just in case
- If you want to restore, do a login first and then push the image
docker psOutput:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 78727078a04b debian:8 "/bin/bash" 13 seconds ago Up 11 seconds unifi
docker commit -p 78727078a04b unifi-20190209 e09f9ac65c8b3095927c14ca0594868f73831bde0800ce66415afeb91aea93cf
docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE unifi-20190209 latest e09f9ac65c8b 39 seconds ago 125.1 MB
docker save -o /volume1/docker/unifi/backups/unifi-20190209.tar unifi-20190209 user:/volume1/docker/unifi/backups# ls -lh total 536M -rw------- 1 root root 536M Feb 9 08:59 unifi-20190209.tar
docker login docker push unifi-20190209
Update a container on your Synology
- Login to your Synology DSM and go to the Docker app
- Go to the 'Image' repository. Check for the image that you started from and verify the tag you used (e.g. jacobalberty/unifi:stable)
- Go to the 'Container' part and stop the container that you want to update
- Go to the 'Registry' part and search for the image. When you found the corresponding image (e.g. jacobalberty/unifi), right click and choose 'Download this image'. You will start seeing the image being downloaded as the number 1 will appear next to 'Image'. Wait until the download is completed.
- Go back to the 'Container' part, select the container (it is still in stopped state). Click on 'Action' and click on 'Clear'. Do not click on Delete. The container will dissapear and reappear.
- Once it reappears, you can start it again.
More screenshots here.
No comments:
Post a Comment