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

Reduce number of layer #2078

Merged
merged 1 commit into from
Jun 30, 2017
Merged

Reduce number of layer #2078

merged 1 commit into from
Jun 30, 2017

Conversation

Dryusdan
Copy link

Somes layer are created and aren't usefull, so I compress this :)

Somes layer are created and aren't usefull, so I compress this :)
@Dryusdan
Copy link
Author

I suggest also use https://github.com/xataz/docker-alpine because his image are more updated than official alpine image :)

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 28, 2017
@bkcsoft
Copy link
Member

bkcsoft commented Jun 28, 2017

LGTM

@tboerger tboerger added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jun 28, 2017
@Bwko
Copy link
Member

Bwko commented Jun 29, 2017

LGTM

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 29, 2017
@silverwind
Copy link
Member

Alternatively, you could also use docker build --squash to reduce all layers to one automatically.

@Dryusdan
Copy link
Author

But, I don't think if --squash is benefit for space disk because the layer from doesn't exist because it's compress with other so multiple image cannot use same FROM (mystic think, I know ^^ )
Another, update image and container are more longer because the 3 first layer doesn't exist, the download and extract are impact...
This is just hypothesis, I not know --squash before and I don't see it option before ^^

@silverwind
Copy link
Member

It's a new option added in 1.13:

docker build has a new experimental --squash flag. When squashing, Docker will take all the filesystem layers produced by a build and collapse them into a single new layer. This can simplify the process of creating minimal container images, but may result in slightly higher overhead when images are moved around (because squashed layers can no longer be shared between images). Docker still caches individual layers to make subsequent builds fast.

So you're right in that it doesn't allow sharing of intermediate layers, but if the aim is to produce the smallest possible image, it's the way to go.

@lunny lunny added this to the 1.2.0 milestone Jun 30, 2017
@lunny lunny added the topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile label Jun 30, 2017
@lunny lunny merged commit 789188f into go-gitea:master Jun 30, 2017
lunny added a commit that referenced this pull request Jun 30, 2017
@Dryusdan Dryusdan deleted the patch-1 branch June 30, 2017 06:23
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants