moby: Permissions problem on Docker 1.8 when reading from stdin

In my build scripts I have a line like so:

    tar c --mtime=2014-01-01 --exclude=__pycache__ --exclude=Dockerfile.template --mode="g=u,o=rX" --owner=root --group=root . | docker build --tag=$IMAGE_NAME:$BUILD_NUMBER -

It does work on Docker < 1.8 but on 1.8 it now throws:

unable to prepare context: unable to extract stdin to temporary context direcotry: lchown /tmp/docker-build-context-183505935/run_entrypoints.sh: operation not permitted

I can change it to use sudo:

        tar c --mtime=2014-01-01 --exclude=__pycache__ --exclude=*.pyc --exclude=Dockerfile.template --mode="g=u,o=rX" . | sudo docker build --tag=$IMAGE_NAME:$BUILD_NUMBER -

and then it works, but I wonder if it’s a bug or some change that affects permissions/users.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 49 (28 by maintainers)

Commits related to this issue

Most upvoted comments

Having to do the kinds of gymnastics @lidel describes in his https://github.com/docker/docker/issues/15785#issuecomment-164030356 for a regression that has been identified since August does not seem reasonable, especially where the source of the problem appears to have been identified (see this https://github.com/docker/docker/pull/14546#issuecomment-148571518). Will a fix still be included in the next release? This appears to be frustrating docker build - builds on several CI platforms.