docker-headless-vnc-container icon indicating copy to clipboard operation
docker-headless-vnc-container copied to clipboard

Refact Dockerfile to reduce image size

Open beginor opened this issue 7 years ago • 2 comments

This vnc container is awesome!

But the image size is huge, about 500MB to transfer, and over 1GB on local disk

$ docker images
REPOSITORY                     TAG                   IMAGE ID            CREATED             SIZE
beginor/geoserver              2.13.0                f35b349982c9        4 weeks ago         412MB
beginor/jexus-x64              5.8.3.2               0508299d9ca6        4 weeks ago         260MB
beginor/jexus                  5.8.3.2               f6a7b9bd020f        4 weeks ago         550MB
beginor/mono                   5.8.1.0               8d8072924cff        4 weeks ago         536MB
consol/ubuntu-xfce-vnc         1.3.0                 9a15a1009598        4 weeks ago         1.15GB
mongo                          3.6                   5b1317f8158f        6 weeks ago         366MB
node                           8-alpine              8c1d32913d93        7 weeks ago         68.1MB
microsoft/dotnet               2-runtime-deps        e82d8fb89902        2 months ago        155MB
nginx                          alpine                537527661905        2 months ago        17.9MB
beginor/jetbrains              1.6.0                 33faaf141cbb        2 months ago        5.44MB

Can we refact the Dockerfile to reduce the image size by following the Best practices for writing Dockerfiles

There are so many RUNs in the Dockerfile, I think we can put all these RUNs into one bash script just like src/ubuntu/install.sh or src/centos/install.sh , and just call RUN $INST_SCRIPTS/install.sh in the Dockerfile.

And there are so many apt-get install in the install scripts, I think we can add --no-install-recommends parameter to prevent downloading of unnessary packages, this will reduce the image size too.

beginor avatar Apr 30 '18 02:04 beginor

+1

Kenith avatar May 23 '18 10:05 Kenith

Feel free to provide some PRs. If I find time I will try to reduce the size

toschneck avatar May 30 '18 13:05 toschneck