user-cont / conu

conu - python API for your containers
http://conu.readthedocs.io/en/latest/
MIT License
164 stars 33 forks source link

DockerImage.copy #363

Closed palusus closed 5 years ago

palusus commented 5 years ago

copy function created

centos-ci commented 5 years ago

Can one of the admins verify this patch?

palusus commented 5 years ago

I tried to copy with skopeo from "docker://alpine:3.6" to "docker-daemon:palusus/alpine:TEST" but it got pulled locally to docker.io/palusus/alpine instead.. trying to find out why it happened

rpitonak commented 5 years ago

[test]

palusus commented 5 years ago

Definitely nice changes. I have one design question. Which of the methods implemented in docker backend are supposed to be used from outside? Could some of them be private?

skopeo/transport_param is definitely supposed not to be used from outside. at first I was thinking that copy could be used from outside.. Right now, hiding copy would make process clumsy. But I think about adding split-modify&burn approach. SkopeoImage could be splitted. “New” image would remember it’s parent - “mounted image”.. It could be modified and then simply burned from source. This could be usefull if copying from same source is expected to be used repeatedly. For example: modify source/mounted image outside of conu, change actual image’s tag and burn it. Then copy method would be private.. [other methods were supposed to simplify use of copy. ] I am not sure if and how much would be abstracting methods that are used now necessary..

Maybe another level could be possibility of multiple source/target images as maps (probably string to image) that would be managed by user. Or something similar.. But I am not sure if this another level would be useful.

(design of project/algorithms absolutely is my favorite part of development :D )

rpitonak commented 5 years ago

[test]