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

Not prompted to do stack docker pull #3328

Closed
ivan-m opened this issue Aug 9, 2017 · 3 comments
Closed

Not prompted to do stack docker pull #3328

ivan-m opened this issue Aug 9, 2017 · 3 comments

Comments

@ivan-m
Copy link
Contributor

ivan-m commented Aug 9, 2017

General summary/comments (optional)

The documentation states that:

The first time you run a command with a new image, you will be prompted to run stack docker pull to pull the image first.

However, instead I received an error message.

Steps to reproduce

I don't know if this is relevant, but due to corporate policies I have to access Docker Hub via a mirror; I shall refer to this as corp.mirror/remote.

I have this in my stack.yaml:

resolver: lts-8.5

docker:
  enable: false
  repo: corp.mirror/remote/fpco/stack-build
  run-args:
    - "--net=bridge"
$ stack build --docker
Running /usr/local/bin/docker inspect corp.mirror/remote/fpco/stack-build:lts-8.5 exited with ExitFailure 1

[]

Error: No such object: corp.mirror/remote/fpco/stack-build:lts-8.5

Expected

stack build --docker should tell me I need to do a stack docker pull.

Actual

$ stack build --docker --verbose

# Snipping stack versioning output

2017-08-09 13:23:26.609217: [debug] Checking for project config at: /project/path/stack.yaml
@(Stack/Config.hs:974:9)
2017-08-09 13:23:26.609866: [debug] Loading project config file stack.yaml
@(Stack/Config.hs:999:13)
2017-08-09 13:23:26.612122: [debug] Run process: /usr/local/bin/docker --version
@(System/Process/Read.hs:306:3)
2017-08-09 13:23:26.627167: [debug] Process finished in 14ms: /usr/local/bin/docker --version
@(System/Process/Read.hs:306:3)
2017-08-09 13:23:26.627709: [debug] Run process: /usr/local/bin/docker inspect corp.mirror/remote/fpco/stack-build:lts-8.5
@(System/Process/Read.hs:306:3)
Running /usr/local/bin/docker inspect corp.mirror/remote/fpco/stack-build:lts-8.5 exited with ExitFailure 1

[]

Error: No such object: corp.mirror/remote/fpco/stack-build:lts-8.5

(stack docker pull does indeed work.)

Stack version

$ stack --version
Version 1.5.0 x86_64

Method of installation

  • Using nix on macOS.
@ivan-m
Copy link
Contributor Author

ivan-m commented Aug 9, 2017

I'm using Docker for Mac 17.0.6.0 with this.

I think the issue is here: if I run docker inspect manually:

$ /usr/local/bin/docker inspect corp.mirror/remote/fpco/stack-build:lts-8.5
[]
Error: No such object: corp.mirror/remote/fpco/stack-build:lts-8.5

There is now an extra []\n more than expected by missingImagePrefixes. This may be due to a change in behaviour from Docker.

@borsboom
Copy link
Contributor

borsboom commented Aug 9, 2017

It should be a pretty easy fix... unfortunately parsing CLI output is going to tend toward this kind of breakage (but the Docker API is even more prone to breakage, so I don't know if using that directly would be an improvement).

Aside: since --install-ghc is now default behaviour, an analogous change would be to make --docker-auto-pull enabled by default. I've opened #3332 to track that change.

@snoyberg
Copy link
Contributor

This was addressed by #4604

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