Skip to content
This repository was archived by the owner on Aug 14, 2020. It is now read-only.

Iaguis/convert local images#37

Merged
jonboulle merged 4 commits intoappc:masterfrom
endocode:iaguis/convert-local-images
Apr 7, 2015
Merged

Iaguis/convert local images#37
jonboulle merged 4 commits intoappc:masterfrom
endocode:iaguis/convert-local-images

Conversation

@iaguis
Copy link
Member

@iaguis iaguis commented Mar 27, 2015

Adds support for converting Docker images generated by "docker save".
Since this file can include several images and tags, we convert whatever
image is there if there's only one or we politely ask the user to select
one image if there're several.

This also changes docker2aci's interface. We now require the prefix
"docker://" to get images from a Docker registry and assume that if it's
not present the user means a local file.

Depends on #36
Fixes #32

@iaguis iaguis force-pushed the iaguis/convert-local-images branch 2 times, most recently from aa77c69 to 3cc2c35 Compare March 30, 2015 10:34
@jonboulle
Copy link
Contributor

This also changes docker2aci's interface. We now require the prefix
"docker://" to get images from a Docker registry and assume that if it's
not present the user means a local file.

I'm 50/50 on this (vs. having a --from-file flag or so). Is your thinking that we should have the same syntax as Rocket? Or that converting from local images will be the more common use case?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eh?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When a layer's rootfs is empty it's not a valid tar file in files generated by docker save so NewCompressedTarReader will fail. In that case, ignoring the error will result in an ACI with a manifest and an empty rootfs directory, which is what we want.

I can add a better comment.

iaguis added 2 commits March 31, 2015 14:42
Adds support for converting Docker images generated by "docker save".
Since this file can include several images and tags, we convert whatever
image is there if there's only one or we politely ask the user to select
one image if there're several.

This also changes docker2aci's interface. We now require the prefix
"docker://" to get images from a Docker registry and assume that if it's
not present the user means a local file.
This makes ACI's app name more consistent with Docker.
@iaguis iaguis force-pushed the iaguis/convert-local-images branch 3 times, most recently from 93087e6 to 6117125 Compare March 31, 2015 14:09
@iaguis
Copy link
Member Author

iaguis commented Mar 31, 2015

This also changes docker2aci's interface. We now require the prefix
"docker://" to get images from a Docker registry and assume that if it's
not present the user means a local file.

I'm 50/50 on this (vs. having a --from-file flag or so). Is your thinking that we should have the same syntax as Rocket? Or that converting from local images will be the more common use case?

Yeah, I'm also on the fence about that. I implemented it this way to keep it simple: adding a --from-file is less convenient for what I think would be a pretty common use case. Since we're already using this syntax in Rocket it seemed a pretty good choice. I don't really know if converting from local images will be the most common use case, probably not.

We also have to think whether we want rocket to support converting files generated by docker save and how to expose it...

@iaguis
Copy link
Member Author

iaguis commented Mar 31, 2015

Thanks a lot for the review!

iaguis added 2 commits March 31, 2015 17:01
Add description and example of converting "docker save" files.
@iaguis iaguis force-pushed the iaguis/convert-local-images branch from 6117125 to 60f74d2 Compare March 31, 2015 15:01
@jonboulle
Copy link
Contributor

We also have to think whether we want rocket to support converting files generated by docker save and how to expose it...

I don't think this is necessary, if people really have exported Docker images around it seems reasonable to expect them to use docker2aci (it's just one more command). My feeling is that the Rocket auto-Docker stuff is mostly useful for referencing images from repositories.

@jonboulle
Copy link
Contributor

Yeah, I'm also on the fence about that. I implemented it this way to keep it simple: adding a --from-file is less convenient for what I think would be a pretty common use case. Since we're already using this syntax in Rocket it seemed a pretty good choice. I don't really know if converting from local images will be the most common use case, probably not.

@philips any feelings on this?

@philips
Copy link
Contributor

philips commented Apr 1, 2015

@jonboulle @iaguis Can you provide a CLI example. I am having a hard time following.

@jonboulle
Copy link
Contributor

@philips

docker2aci quay.io/coreos/etcd
docker2aci --from-file ./etcd

vs. (like rkt)

docker2aci docker://quay.io/coreos/etcd
docker2aci ./etcd

@philips
Copy link
Contributor

philips commented Apr 1, 2015

I see. The other option is to just always make it a url like file://etcd

@jonboulle
Copy link
Contributor

Sure, I consider ./ a minor optimisation over that

@philips
Copy link
Contributor

philips commented Apr 1, 2015

Yea, we just need to be explicit. The current state in rkt bothers and we need to fix it because the rules are ambiguous and can lead to mistakes or confusion.

This is a stupid example:

cd $HOME/src
./github.com/coreos/rocket/bin/rkt run github.com/coreos/etcd
github.com/coreos/etcd: error reading image header: read github.com/coreos/etcd: is a directory

@jonboulle
Copy link
Contributor

@philips agreed, it just hasn't bothered me personally enough yet to
prioritise it. Do you want to file another readme-driven-development issue
on coreos/rkt?

On Tue, Mar 31, 2015 at 10:20 PM, Brandon Philips [email protected]
wrote:

Yea, we just need to be explicit. The current state in rkt bothers and we
need to fix it because the rules are ambiguous and can lead to mistakes or
confusion.

This is a stupid example:

cd $HOME/src
./github.com/coreos/rocket/bin/rkt run github.com/coreos/etcdgithub.com/coreos/etcd: error reading image header: read github.com/coreos/etcd: is a directory


Reply to this email directly or view it on GitHub
#37 (comment).

@philips
Copy link
Contributor

philips commented Apr 1, 2015

@jonboulle Yes: rkt/rkt#715

@jonboulle
Copy link
Contributor

danke!

On Tue, Mar 31, 2015 at 10:37 PM, Brandon Philips [email protected]
wrote:

@jonboulle https://github.com/jonboulle Yes: rkt/rkt#715
rkt/rkt#715


Reply to this email directly or view it on GitHub
#37 (comment).

@jonboulle
Copy link
Contributor

I propose we land this as-is and can revisit the exact UX after we sort it out in rkt, @philips that sound reasonable to you?

@philips
Copy link
Contributor

philips commented Apr 5, 2015

@jonboulle Sure, go for it.

jonboulle added a commit that referenced this pull request Apr 7, 2015
@jonboulle jonboulle merged commit e567e26 into appc:master Apr 7, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docker2aci should work with local docker images

3 participants