Skip to content

docker build does not preserve xattrs in the generated image #35699

@mterron

Description

@mterron

Description
Docker containers do not preserve extended attributes

Steps to reproduce the issue:

  1. In the build phase, set an extended attribute on a file
  2. Run the container and check for the existence of said attribute

I pushed a minimal image to the Docker Hub: mterron/xattrs
The Dockerfile for it is inside the image at /Dockerfile so you can build it yourself and reproduce.

Describe the results you received:
Build phase:

# attr -l /path/to/file
Attribute "pax.flags" has a 2 byte value for /path/to/file

Run phase

# attr -l /path/to/file
[empty response]

Describe the results you expected:
When running an image I expect the xattrs to be the same as the ones set during build.

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:

Client:
 Version:      17.10.0-ce
 API version:  1.33
 Go version:   go1.9.2
 Git commit:   ba9946cf23
 Built:        Tue Nov 21 12:38:19 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.10.0-ce
 API version:  1.33 (minimum version 1.12)
 Go version:   go1.9.2
 Git commit:   v17.10.0-ce
 Built:        Tue Nov 21 12:37:42 2017
 OS/Arch:      linux/amd64
 Experimental: false

Output of docker info:

Containers: 4
 Running: 3
 Paused: 0
 Stopped: 1
Images: 47
Server Version: 17.10.0-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 06b9cb35161009dcb7123345749fef02f7cea8e0
runc version: 0351df1c5a66838d0c392b4ac4cf9450de844e2d
init version: 949e6facb77383876aeff8a6944dde66b3089574
Kernel Version: 4.9.65-1-hardened
Operating System: Alpine Linux v3.7
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 3.732GiB
Name: nano
ID: 
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Username: 
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: true

WARNING: No swap limit support

Additional environment details (AWS, VirtualBox, physical, etc.):
Physical environment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions