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

The maximum number of layers is undocumented. #8230

Closed
cowlinator opened this issue Feb 13, 2019 · 8 comments
Closed

The maximum number of layers is undocumented. #8230

cowlinator opened this issue Feb 13, 2019 · 8 comments
Labels
area/engine Issue affects Docker engine/daemon lifecycle/locked

Comments

@cowlinator
Copy link
Contributor

cowlinator commented Feb 13, 2019

Problem description

The maximum number of layers is undocumented.

Problem location

I couldn't find the information I wanted. I expected to find it near the following URL: https://docs.docker.com/engine/reference/builder/

Suggestions for a fix

The maximum number of layers that can exist in an image's history (127 layers) is not documented anywhere. This seems to be a limitation imposed by AUFS, from what I can tell.

Searching for phrases such as "max layers", "layer limit", "image depth limit", "maximum dockerfile steps", "max history length", etc. come up empty.

@bermudezmt bermudezmt added area/engine Issue affects Docker engine/daemon topic/reference labels Feb 14, 2019
@bermudezmt
Copy link
Contributor

@thaJeztah Sorry you're on docs speed dial, but perhaps we can look into improving the "Dockerfile Reference" page soon?

@cowlinator
Copy link
Contributor Author

Actually, it appears that 127 is not the correct number. See https://stackoverflow.com/questions/39382518/whats-the-reason-for-the-42-layer-limit-in-docker/54936566#54936566
Is there a maximum number of layers at all? Now I'm not so sure.

@thaJeztah
Copy link
Member

The "42 layer limit" on aufs was on older versions of aufs, but should no longer be the case.

However, the 127 layer limit is still there. This is due to a restriction of Linux not accepting more than X arguments to a syscall that's used.

Although this limit can be raised in modern kernels, it's not the default, so if we'd go beyond that maximum, an Image built on one machine may not be usable on another machine.

@thaJeztah
Copy link
Member

Actually may not be the maximum number of arguments, but argument length (i'll have to dig it up), but yes, the limit is currently 127 layers

@nigelpoulton
Copy link
Contributor

I love topics like this, but I think it's potentially one that the docs should avoid.

As mentioned above, different versions of AUFS potentially have different limits, and modern kernels may let us raise limits. This is all assuming only AUFS and not other storage drivers.

I can't personally think of a realistic way that the docs can handle a topic like this (too many variables and not viable to keep up-to-date).

I propose we close this.

@nigelpoulton
Copy link
Contributor

Ping @cowlinator @thaJeztah ^^ I reckon we close this. Great discussion, but one the docs should avoid IMO.

@bermudezmt
Copy link
Contributor

Thanks, @nigelpoulton . Closing as per #8230 (comment). @cowlinator please submit a new issue if you have additional concerns.

rubensa added a commit to rubensa/docker-ubuntu-tini-dev that referenced this issue Jul 7, 2022
adf-ncgr added a commit to legumeinfo/sequenceserver that referenced this issue Dec 5, 2022
…, only include mRNAs not CDSs for now, due to exceeding the maximum number of levels that a docker build will allow (not documented, seemingly by design: docker/docs#8230); I think basically the use of an individual command per library for the sake of caching is probably the culprit here, but will need to consult @nathanweeks before doing anything rash and ignorant here.
@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

/lifecycle locked

@docker docker locked and limited conversation to collaborators Mar 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/engine Issue affects Docker engine/daemon lifecycle/locked
Projects
None yet
Development

No branches or pull requests

5 participants