Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull specific images using --docker-auto-pull option #4598

Closed
falsandtru opened this issue Feb 20, 2019 · 10 comments
Closed

Pull specific images using --docker-auto-pull option #4598

falsandtru opened this issue Feb 20, 2019 · 10 comments

Comments

@falsandtru
Copy link

General summary/comments (optional)

Steps to reproduce

Expected

Pull a suitable image automatically.

Actual

$ stack --docker-auto-pull install
Error: No such object: fpco/stack-build:lts-13.8
Received ExitFailure 1 when running
Raw command: /snap/bin/docker inspect fpco/stack-build:lts-13.8
Standard output:

[]

Stack version

$ stack --version
Version 1.9.3, Git revision 40cf7b37526b86d1676da82167ea8758a854953b (6211 commits) x86_64 hpack-0.31.1

Method of installation

  • Official binary, downloaded from stackage.org or fpcomplete's package repository
@falsandtru falsandtru changed the title --docker-auto-pull option doesn't pull specific images Pull specific images using --docker-auto-pull option Feb 20, 2019
@dbaynard
Copy link
Contributor

dbaynard commented Mar 4, 2019

Hi @falsandtru, thanks for raising this issue. What happens if you try it again, now? Please run with --verbose and paste the verbose log output here.

@falsandtru
Copy link
Author

$ stack --docker-auto-pull --verbose install
Version 1.9.3, Git revision 40cf7b37526b86d1676da82167ea8758a854953b (6211 commits) x86_64 hpack-0.31.1
2019-03-05 04:08:10.688835: [debug] Checking for project config at: .../haskell-examples/stack.yaml
2019-03-05 04:08:10.690173: [debug] Loading project config file stack.yaml
2019-03-05 04:08:10.694951: [debug] Run process: /snap/bin/docker --version
2019-03-05 04:08:10.966740: [debug] Process finished in 272ms: /snap/bin/docker --version
2019-03-05 04:08:10.967757: [debug] Run process: /snap/bin/docker inspect fpco/stack-build:lts-13.9
Error: No such object: fpco/stack-build:lts-13.9
Received ExitFailure 1 when running
Raw command: /snap/bin/docker inspect fpco/stack-build:lts-13.9
Standard output:

[]

@falsandtru
Copy link
Author

repro:

  1. clone https://github.com/falsandtru/haskell-examples
  2. run stack --docker --docker-auto-pull --verbose install

@dbaynard
Copy link
Contributor

dbaynard commented Mar 4, 2019

That docker inspect command is failing for me, on arch

@dbaynard
Copy link
Contributor

dbaynard commented Mar 4, 2019

Yet after a docker pull fpco/stack-build:lts-13.10 I can run docker inspect fpco/stack-build:lts-13.10 (though not any other version).

@dbaynard
Copy link
Contributor

dbaynard commented Mar 4, 2019

@borsboom Would you take a look, please. My docker is:

Docker version 18.09.0-ce, build 4d60db472b

Note also that docker inspect fpco/stack-build works.

I wonder if the behaviour of inspect has changed?

@borsboom
Copy link
Contributor

borsboom commented Mar 5, 2019

@falsandtru I'm able to reproduce this locally.

@dbaynard The behaviour you're describing is what I would expect. docker inspect is supposed to fail if you don't have the image locally. Stack tries running it to determine whether you have the image, and is then supposed to docker pull the image if that fails with a message that indicates the image isn't there. Something seems to be going wrong in that process, though.

@borsboom
Copy link
Contributor

borsboom commented Mar 6, 2019

It looks like, at some point, reading the standard output of docker inspect in the case where it exits with an error stopped working, so stack isn't detecting that the error is due to missing image rather than being some other general error.

@borsboom
Copy link
Contributor

borsboom commented Mar 6, 2019

PR with fix: #4604

snoyberg added a commit that referenced this issue Mar 13, 2019
…pull

Docker: fix pull missing images with `--docker-auto-pull` (fixes #4598)
@snoyberg
Copy link
Contributor

This was fixed in #4604, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants