The docker binary exposes all the functions needed to do this without root access and without direct access to the docker paths. The current approach doesn't seem to be portable. Why can't the docker export command be used?
sudo ./export-container.py 9d8291fb57d4 test
Exporting Docker container to a lxc container
('Docker container id: ', '9d8291fb57d4')
('New container name: ', 'test')
('Full container id ', '9d8291fb57d474082ad4e91ab6625e5e9b8f2da673ede41bfad8647e13bf447b')
Container exists [/var/lib/docker/containers/9d8291fb57d474082ad4e91ab6625e5e9b8f2da673ede41bfad8647e13bf447b]? True
Traceback (most recent call last):
File "./export-container.py", line 208, in <module>
main()
File "./export-container.py", line 199, in main
container.is_valid_container()
File "./export-container.py", line 50, in is_valid_container
self.lxc_rootfs_exists()
File "./export-container.py", line 64, in lxc_rootfs_exists
lines = tuple(open(self.config, "r"))
IOError: [Errno 2] No such file or directory: '/var/lib/docker/containers/9d8291fb57d474082ad4e91ab6625e5e9b8f2da673ede41bfad8647e13bf447b/config.lxc'
The docker binary exposes all the functions needed to do this without root access and without direct access to the docker paths. The current approach doesn't seem to be portable. Why can't the docker export command be used?