xamindar Posted March 14, 2015 Share Posted March 14, 2015 Is it possible to back up my existing docker before updating it? As it runs on btrfs, can I just snapshot it somehow? Quote Link to comment
NAS Posted March 14, 2015 Share Posted March 14, 2015 Docker on unRAID has 3 components 1. Config file. Small. 2. The container. Large but disposable since you can get iot form the online repo again (assuming you dont use EDGE) 3. The data files under appdata BTRFS snapshots dont cover all 3 of these. T Quote Link to comment
gfjardim Posted March 14, 2015 Share Posted March 14, 2015 I've made a vary basic script to backup/restore containers a while ago, but only tested it twice, so be careful with it. #!/bin/bash D="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")" if [[ -n $1 ]]; then backup_path=$1 else exit 1 fi if [[ -f ${backup_path}/restore.sh ]]; then echo Please choose an empty directory exit 0 fi running_containers=$(docker ps -q) if [[ -n $running_containers ]]; then docker stop ${running_containers} fi echo -e "#!/bin/bash\n" > ${backup_path}/restore.sh for container in $(docker ps -a -q); do image_name=$(docker inspect -f "{{.Config.Image}}" ${container}); image_id=$(docker inspect -f "{{.Image}}" ${container}) container_name=$(docker inspect -f "{{.Name}}" ${container} | grep -Po '/\K.*') container_cmd=$(${D}/docker_cmd.php ${container_name}) eval "docker save ${image_id} > ${backup_path}/${container_name}.tar"; echo "docker load < ${backup_path}/${container_name}.tar" >> ${backup_path}/restore.sh; echo "docker tag ${image_id} ${image_name}" >> ${backup_path}/restore.sh; echo "$container_cmd" >> ${backup_path}/restore.sh; done chmod +x ${backup_path}/restore.sh if [[ -n $running_containers ]]; then docker start ${running_containers} fi Quote Link to comment
xamindar Posted March 14, 2015 Author Share Posted March 14, 2015 Thanks for the replies and info. Since you responded, gfjardim, I am wanting to back up your btsync container before upgrading in case it upgrades to sync 2.0. Sync 2.0 is incompatible with the old 1.4 clients which all my other devices run. Which version does it update to? Quote Link to comment
gfjardim Posted March 14, 2015 Share Posted March 14, 2015 Thanks for the replies and info. Since you responded, gfjardim, I am wanting to back up your btsync container before upgrading in case it upgrades to sync 2.0. Sync 2.0 is incompatible with the old 1.4 clients which all my other devices run. Which version does it update to? BTSync 2.0.82 Quote Link to comment
BRiT Posted March 14, 2015 Share Posted March 14, 2015 Thanks for the replies and info. Since you responded, gfjardim, I am wanting to back up your btsync container before upgrading in case it upgrades to sync 2.0. Sync 2.0 is incompatible with the old 1.4 clients which all my other devices run. Which version does it update to? And this is exactly why Dockers should be versioned and labeled and never auto update. They should always be exact snapshots in time. One never knows if an update will break everything or not. It's even worse with using developer branches of the application in question. Quote Link to comment
xamindar Posted March 14, 2015 Author Share Posted March 14, 2015 Thanks for the replies and info. Since you responded, gfjardim, I am wanting to back up your btsync container before upgrading in case it upgrades to sync 2.0. Sync 2.0 is incompatible with the old 1.4 clients which all my other devices run. Which version does it update to? BTSync 2.0.82 Crap ok, thanks for the answer Save me the trouble of updating to find out it doesn't work with anything anymore. Quote Link to comment
AndreM Posted March 28, 2015 Share Posted March 28, 2015 Docker on unRAID has 3 components 1. Config file. Small. 2. The container. Large but disposable since you can get iot form the online repo again (assuming you dont use EDGE) 3. The data files under appdata BTRFS snapshots dont cover all 3 of these. T What is the location of the config file? I would like to make a backup of just appdata and my container configuration (The volume mappings, port mappings and other variables). I know where the appdata is, but where is the container configuration stored? Quote Link to comment
trurl Posted March 28, 2015 Share Posted March 28, 2015 Docker on unRAID has 3 components 1. Config file. Small. 2. The container. Large but disposable since you can get iot form the online repo again (assuming you dont use EDGE) 3. The data files under appdata BTRFS snapshots dont cover all 3 of these. T What is the location of the config file? I would like to make a backup of just appdata and my container configuration (The volume mappings, port mappings and other variables). I know where the appdata is, but where is the container configuration stored? Not entirely sure what is meant by config file, since it is typically in a mapped volume, probably part of appdata for most dockers. Perhaps he meant the template settings. Those are in /boot/config/plugins/dockerMan/templates-user Quote Link to comment
AndreM Posted March 29, 2015 Share Posted March 29, 2015 Docker on unRAID has 3 components 1. Config file. Small. 2. The container. Large but disposable since you can get iot form the online repo again (assuming you dont use EDGE) 3. The data files under appdata BTRFS snapshots dont cover all 3 of these. T What is the location of the config file? I would like to make a backup of just appdata and my container configuration (The volume mappings, port mappings and other variables). I know where the appdata is, but where is the container configuration stored? Not entirely sure what is meant by config file, since it is typically in a mapped volume, probably part of appdata for most dockers. Perhaps he meant the template settings. Those are in /boot/config/plugins/dockerMan/templates-user Great, thank you. The contents of the templates-user directory was exactly what I was looking for! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.