Skip to content
This repository was archived by the owner on Oct 30, 2018. It is now read-only.

Use digests when pulling mkimage images. - #170

Closed
rn wants to merge 1 commit into
moby:masterfrom
rn:fix
Closed

rn wants to merge 1 commit into
moby:masterfrom
rn:fix

Conversation

@rn

@rn rn commented Oct 20, 2017

Copy link
Copy Markdown
Member

With DOCKER_CONTENT_TRUST=1 docker run :
the docker command will print on stdout something like:

Tagging with ... on the first pull which then ends
up the in the output image.

Pulling with digest stops that message

Signed-off-by: Rolf Neugebauer rolf.neugebauer@docker.com

With DOCKER_CONTENT_TRUST=1 docker run <image>:<tag>
the docker command will print on stdout something like:

Tagging <image> with ... on the first pull which then ends
up the in the output image.

Pulling with digest stops that message

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
@ijc

ijc commented Oct 20, 2017

Copy link
Copy Markdown
Collaborator

This seems OK as a workaround for now, but this shouldn't be needed -- I think it is a moby bug if it is logging to stdout when it is not a tty, since it breaks the docker run image:tag cat foo use case. Shall we have a moby/moby or moby/cli bug to go with it?

@ijc

ijc commented Oct 20, 2017

Copy link
Copy Markdown
Collaborator

Hrm. should we be using --attach=STDIN rather than -i? Maybe this is our fault?

@rn

rn commented Oct 20, 2017 via email

Copy link
Copy Markdown
Member Author

@ijc

ijc commented Oct 20, 2017

Copy link
Copy Markdown
Collaborator

I'm having a play now.

@ijc

ijc commented Oct 20, 2017

Copy link
Copy Markdown
Collaborator

I can't seem to repro the behaviour seen in linuxkit/linuxkit#2612 with 17.09 or 17.10, either with moby tool with

moby build -format gcp linuxkit.yml

or manually with:

$ moby build -format tar-kernel-initrd linuxkit.yml
$ cat linuxkit-initrd.tar |  docker run --network=none --rm -i linuxkit/mkimage-gcp:d1883809d212ce048f60beb0308a4d2b14c256af  > bar

Maybe it is related to the version of docker? I'll try some older versions.

@ijc

ijc commented Oct 20, 2017

Copy link
Copy Markdown
Collaborator

I needed to docker rmi more thoroughly to provoke the pull and print. I can now reproduce with 17.06 and 17.10.

@ijc

ijc commented Oct 20, 2017

Copy link
Copy Markdown
Collaborator

Using --attach=stdin --attach=stdout doesn't work at all. Combining with -i doesn't avoid the issue seen here, which is due to https://github.com/docker/cli/blob/master/cli/command/image/trust.go#L358.

Doing the pull separately first does avoid the issue, which might be better than having to mess around with digests until Docker CLI can be fixed, it's slightly racy in that someone could delete the image between the pull and the run, but that seems unlikely...

@ijc

ijc commented Oct 20, 2017

Copy link
Copy Markdown
Collaborator

Reported at docker/cli#631.

I have an alternative workaround at #171.

@justincormack

Copy link
Copy Markdown
Contributor

Closing as merged #171

@rn
rn deleted the fix branch October 30, 2017 10:43
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.

3 participants