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 image size - #98 #102

Closed
wants to merge 2 commits into from
Closed

Reduce image size - #98 #102

wants to merge 2 commits into from

Conversation

PhilippeChepy
Copy link

  • Reduced image size from 550,5 MB to 386 MB.

Package installation is now run in one command.
Cleanup process is now done at end of script.
Merged most RUN commands in Dockerfile.
Replaced ADD commands by COPY of the whole /etc and /usr in one
operation.
@PhilippeChepy PhilippeChepy mentioned this pull request Mar 11, 2016
3 tasks
@@ -1,74 +1,71 @@
FROM ubuntu:14.04
Copy link

Choose a reason for hiding this comment

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

maybe move to Debian:8.3 can help

Copy link
Author

Choose a reason for hiding this comment

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

I have tested with Debian:jessie and curiously size of image increased. But it produce a working image as well.

Copy link

Choose a reason for hiding this comment

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

works for me, but i use other cleanup process

apt-get -y clean && apt-get -y autoclean && apt-get -y autoremove && \
cp -R /usr/share/locale/en\@* /tmp/ && rm -rf /usr/share/locale/* && mv /tmp/en\@* /usr/share/locale/ && \
rm -rf /var/cache/debconf/*-old && rm -rf /var/lib/apt/lists/* && rm -rf /usr/share/doc/*

@tomav
Copy link
Contributor

tomav commented Mar 14, 2016

@PhilippeChepy thanks for this work!
Is there a reason you moved a lot of things into target/ folder?
Are you sure it won't break something on running docker mail servers?

@tomav
Copy link
Contributor

tomav commented Mar 18, 2016

Hi @PhilippeChepy, let me know. Note that the branch has conflicts.

@PhilippeChepy
Copy link
Author

I moved all files that needs to be in image in the target/ folder just for practical reasons. I prefer doing one COPY instead of multiple ADDs in my Dockerfile. If you want to add a file in your image, you just have to add that file in the target/ folder.
I guess it's not very important for the size reduction of the image.

@tomav
Copy link
Contributor

tomav commented Mar 19, 2016

I'm merging manually and checking things.

@tomav tomav mentioned this pull request Mar 19, 2016
@tomav
Copy link
Contributor

tomav commented Apr 1, 2016

This PR is conflicting again. @PhilippeChepy could you have a look?
Thank you.

@tomav tomav changed the title In response to https://github.com/tomav/docker-mailserver/issues/98 Reduce image size - #98 Apr 1, 2016
@tomav tomav added wip and removed can be merged labels Apr 5, 2016
@tomav
Copy link
Contributor

tomav commented Apr 11, 2016

Closed due to inactivity.

@tomav tomav closed this Apr 11, 2016
RichardFevrier pushed a commit to RichardFevrier/docker-mailserver that referenced this pull request Aug 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants