Compare commits

...

2 commits

Author SHA1 Message Date
Ben Darwin
801a2a97a6
(fix) detect DockerRootDir instead of assuming default (#1) 2025-04-02 16:24:02 -05:00
a1ff2774a7 (docs): update README. 2025-02-21 20:21:31 +00:00
2 changed files with 34 additions and 3 deletions

View file

@ -4,3 +4,34 @@ Migrate from Docker to Podman.
fly-to-podman is a small bash script that helps you migrate from Docker to Podman. It will migrate your Docker containers, images, and volumes to Podman, as well as keep your container data and configurations (mounts, ports, etc.) intact.
Full blog post: [From Docker to Podman: full migration to rootless](https://www.edu4rdshl.dev/posts/from-docker-to-podman-full-migration-to-rootless/)
# What it does
- Migrate Docker images to Podman (including tags)
- Migrate Docker volumes to Podman (including all data)
- Migrate Docker networks to Podman (including names, IPs, gateways, IP ranges, etc.)
- Migrate Docker containers to Podman (including names, IDs, and statuses such as restart policy, etc.)
- Keep container data and configurations (mounts, exposed ports, etc.)
# Requirements
- Docker
- Podman
- bash
- jq
- rsync
# Usage
```bash
fly-to-podman.sh {images|volumes|containers|full}
images: Migrate Docker images to Podman
volumes: Migrate Docker volumes to Podman
containers: Migrate Docker containers to Podman
networks: Migrate Docker networks to Podman
full: Migrate Docker images, volumes, and containers to Podman
```
# Issues and contributions
If you find any issues or have any suggestions, please open an issue or a pull request.

View file

@ -27,9 +27,9 @@ migrate_images() {
# Migrate volumes
migrate_volumes() {
echo "Migrating Docker volumes to Podman..."
# Get the path to the Podman volumes directory
# Get the path to the Podman volumes directory (and guess at the Docker volumes directory)
PODMAN_VOLUMES_PATH=$(podman info --format json | jq -r '.store.volumePath')
DOCKER_VOLUMES_PATH="/var/lib/docker/volumes"
DOCKER_VOLUMES_PATH=$(docker system info -fjson | jq -r '.DockerRootDir')/volumes
RSYNC_OPTS=""
if [[ "$UID" -ne 0 ]]; then