Skip to content

Instantly share code, notes, and snippets.

View casesolved-co-uk's full-sized avatar
💭
Open for business

Richard Case casesolved-co-uk

💭
Open for business
View GitHub Profile
@casesolved-co-uk
casesolved-co-uk / docker.sh
Created February 22, 2026 02:29
How to export and import a set of images and containers in docker to change storage driver to btrfs
# export script for currently running containers
# You have to compile python >3.9, create venv, activate, install poetry, clone the autocompose git repo
docker save -o /opt/all-images.tar $(docker images --format '{{.Repository}}:{{.Tag}}')
cd /root/docker-autocompose; poetry run autocompose $(docker ps -aq) > /opt/compose.yml
# for loading and starting saved containers and images
docker load -i /opt/all-images.tar
docker compose -f /opt/compose.yml up -d