I use following command to backup lxc :
lxc publish CONTAINER_NAME/SNAPSHOT_NAME --alias my-export
lxc image export my-export .
This will create a new LXD image from your container and export it as a tarball in your current directory. You can then ship that tarball to your target host and do:
lxc image import TARBALL --alias my-export
lxc init my-export NEW-CONTAINER
After import the container,I find the environment variables doesn't backup. I use command to check the environment variables.
env
How should I totally backup lxc container?
Thank you very much.