Skip to content

DOCKER_BUILDKIT=1 docker build causing files to be owned by nobody:nobody #943

Closed

Description

Sorry this is my first time reporting an issue.... I'm seeing this on the linux build, but not on the mac osx build.

Simple docker file:

FROM ruby:2.2.5-alpine

RUN mkdir -p /app
WORKDIR /app/
COPY . /app/

when running with buildkit, all of the files ending up owned by nobody:nobody, and can't be touched, written to etc:

DOCKER_BUILDKIT=1 docker build . -t with_buildkit

docker run -i -t with_buildkit ls -lart
total 47008
-rw-r--r--    1 nobody   nobody         231 Jul 27  2018 .bashrc
-rw-r--r--    1 nobody   nobody         193 Jul 27  2018 .bash_profile
-rw-r--r--    1 nobody   nobody          18 Jul 27  2018 .bash_logout
-rw-rw-r--    1 nobody   nobody         295 Apr 11 03:11 Dockerfile.bundle
-rw-rw-r--    1 nobody   nobody         103 Apr 11 03:14 .env-ci
-rw-rw-r--    1 nobody   nobody         469 Apr 11 22:40 docker-compose.yml.kcra
-rw-rw-r--    1 nobody   nobody         172 Apr 11 22:45 docker-compose.yml
-rw-rw-r--    1 nobody   nobody         114 Apr 11 23:08 Dockerfile.base
-rw-rw-r--    1 nobody   nobody    48050098 Apr 15 21:15 docker.tgz
-rw-rw-r--    1 nobody   nobody          35 Apr 15 22:04 Dockerfile.e2
drwxrwxr-x    2 nobody   nobody         138 Apr 15 22:52 docker
drwx------    2 nobody   nobody          29 Apr 15 22:52 .ssh
drwx------    2 nobody   nobody          26 Apr 15 22:52 .docker
-rw-rw-r--    1 nobody   nobody          75 Apr 15 23:28 Dockerfile.sudo
-rw-rw-r--    1 nobody   nobody          92 Apr 15 23:31 Dockerfile.1
-rw-rw-r--    1 nobody   nobody         106 Apr 15 23:31 Dockerfile.2
-rw-rw-r--    1 nobody   nobody          47 Apr 15 23:31 Dockerfile.3
-rw-------    1 nobody   nobody       12950 Apr 16 02:18 .bash_history
-rw-rw-r--    1 nobody   nobody          71 Apr 16 13:26 Dockerfile
-rw-------    1 nobody   nobody        5563 Apr 16 13:26 .viminfo
drwxr-xr-x    1 nobody   nobody        4096 Apr 16 13:26 .
drwxr-xr-x    1 root     root             6 Apr 16 13:27 ..

docker run -i -t with_buildkit touch Dockerfile.1
touch: Dockerfile.1: Permission denied

When run without buildkit, things seem OK

DOCKER_BUILDKIT= docker build . -t without_buildkit
docker run -i -t without_buildkit ls -lart
total 47008
-rw-r--r--    1 root     root           231 Jul 27  2018 .bashrc
-rw-r--r--    1 root     root           193 Jul 27  2018 .bash_profile
-rw-r--r--    1 root     root            18 Jul 27  2018 .bash_logout
drwx------    2 root     root            29 Feb 24 22:38 .ssh
...

I tried to change user, tried to RUN sudo chown -R root:root /app and got Operation Not Permitted, and tried a few other things to no avail.

 docker version
Client: Docker Engine - Community
 Version:           18.09.2
 API version:       1.39
 Go version:        go1.10.8
 Git commit:        6247962
 Built:             Sun Feb 10 04:11:47 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.2
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.6
  Git commit:       6247962
  Built:            Sun Feb 10 04:20:28 2019
  OS/Arch:          linux/amd64
  Experimental:     false

Any help or pointers or tell me to go ask this question somewhere else appreciated....

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

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions