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

Che dockerfiles: apply chmod only to folders to fool COW #6272

Merged
merged 1 commit into from
Sep 14, 2017

Conversation

l0rd
Copy link
Contributor

@l0rd l0rd commented Sep 14, 2017

What does this PR do?

Modify Che alpine and CentOS based Dockerfiles to apply chmod only to folders.

What issues does this PR fix or reference?

#6200 (comment): this single instruction at the end of the Dockerfile added a layer of ~185M

RUN chmod -R 0777 /home/user

That's because of copy on write: every file which permissions have been modified is duplicated in the new layer. To avoid that (and fool cow) we apply chmod only to folders:

RUN find /home/user -type d -exec chmod 777 {} \;

@codenvy-ci
Copy link

Can one of the admins verify this patch?

1 similar comment
@codenvy-ci
Copy link

Can one of the admins verify this patch?

@@ -40,4 +40,4 @@ ENTRYPOINT ["/entrypoint.sh"]
RUN mkdir /logs /data && \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember why this instruction couldn't be merged with previous RUN instruction ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benoitf I don't think we have ever discussed that

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK It was discussed there #6200 (review)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway I can't see any problem to do it. But it should be carefully tested.

@l0rd l0rd merged commit 9e5193c into eclipse-che:master Sep 14, 2017
@l0rd l0rd deleted the fix-docker-image-size branch September 14, 2017 15:33
@l0rd l0rd added the kind/enhancement A feature request - must adhere to the feature request template. label Sep 14, 2017
@l0rd l0rd added this to the 5.18.0 milestone Sep 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A feature request - must adhere to the feature request template.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants