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

Dockerfiles unnecessarily large #247

Open
tholiao opened this issue Dec 13, 2018 · 0 comments
Open

Dockerfiles unnecessarily large #247

tholiao opened this issue Dec 13, 2018 · 0 comments

Comments

@tholiao
Copy link

tholiao commented Dec 13, 2018

Dockerfiles have too many layers

Problem description:

Dockerfiles are unnecessarily long, i.e. too many layers during build and retain build artifacts

Problem example:

RUN apt-get -y install git make cmake unzip
RUN apt-get -y install libxrandr2 libxinerama-dev libxi6 libxcursor-dev

from rllab/docker/Dockerfile lines 27 and 33

Problem Implication:

unnecessarily large docker images -> harder to run multiple images on same machine

Solution description:

best practices recommend chaining / combining as many commands as possible to remove unnecessary layers

Solution example:

RUN apt-get update && apt-get install -y \
    build-dep glfw \
    libxrandr2 libxinerama-dev libxi6 libxcursor-dev \
 && rm -rf /var/lib/apt/lists/*

Solution source:

Best practices for writing Dockerfiles

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

No branches or pull requests

1 participant