8
Moving docker image data between VMs
(lemmy.ml)
A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.
The first rule of containers is that you do not store any data in containers.
The second rule of containers is that you run them from a versioned config with proper volumes and tagging. Always.
If you obey these rules, then it's as simple as moving the volumes to another host and starting your containers. They're fully portable that way.
Do you mean they should be bind mounts? From here, a bind mount should look like this:
version: '3.8'
services: my_container: image: my_image:latest volumes: - /path/on/host:/path/in/container
So referring to my Firefly compose above, then I shoudl simply be able to copy over the
/var/www/html/storage/upload
for the main app data and the database stored in here/var/lib/mysql
can just be copied over? but then why does my local folder not have anystrorage/upload
folders?user@vm101:/var/www/html$ ls index.html