Skip to content

Is it expected that a docker layer might have no content? #20917

@rseddon

Description

@rseddon

Output of docker version:

$ docker version
Client:
 Version:      1.8.2-el7.centos
 API version:  1.20
 Package Version: docker-1.8.2-10.el7.centos.x86_64
 Go version:   go1.4.2
 Git commit:   a01dc02/1.8.2
 Built:        
 OS/Arch:      linux/amd64

Server:
 Version:      1.8.2-el7.centos
 API version:  1.20
 Package Version: 
 Go version:   go1.4.2
 Git commit:   a01dc02/1.8.2
 Built:        
 OS/Arch:      linux/amd64

Output of docker info:

Containers: 1
Images: 14
Storage Driver: devicemapper
 Pool Name: docker-253:0-394064-pool
 Pool Blocksize: 65.54 kB
 Backing Filesystem: extfs
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 2.982 GB
 Data Space Total: 107.4 GB
 Data Space Available: 44.32 GB
 Metadata Space Used: 3.928 MB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.144 GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.107-RHEL7 (2015-12-01)
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.10.0-327.10.1.el7.x86_64
Operating System: CentOS Linux 7 (Core)
CPUs: 2
Total Memory: 3.699 GiB
Name: unknown001C42425BFC
ID: ZDCO:ZBTO:FQVB:N2QK:UU7V:KSZY:DZ2G:BB5L:PPYD:VSTX:US6R:T7XN
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled

Provide additional environment details (AWS, VirtualBox, physical, etc.):

List the steps to reproduce the issue:

  1. Build and push a simple docker file using the version of Docker above running on CentOS 7.2
$ cat Dockerfile
FROM docker/whalesay:latest
RUN apt-get -y update && apt-get install -y fortunes
RUN apt-get install dos2unix
CMD /usr/games/fortune -a | cowsay

$ docker build .
$ docker tag dfe7611d91f8 192.168.1.83:18440/test/docker-whale2
$ docker push 192.168.1.83:18440/test/docker-whale2

Describe the results you received:

The first layer uploaded for this has 1024 bytes of nothing but zeros sent in the PATCH request.

Describe the results you expected:

I don't know if this is a problem or not, so I have no expectations. :-) FWIW I haven't seen this occur with later versions of Docker.

The reason I am filing this is that we have an open issue against the Docker implementation in Nexus, pushing of Docker images from Docker 1.82 to Nexus is failing due to this empty layer:

https://issues.sonatype.org/browse/NEXUS-9847

Is it expected that a layer might consist of nothing but 1024 bytes of zeros? Issue #18226 seems to indicate that this is expected, although there isn't any explanation of why this might happen. If this is expected I'll recommend that we change Nexus to handle this case.

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