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

Optimization: issue rm in same code block as COPY #28

Open
riazarbi opened this issue Aug 15, 2019 · 1 comment
Open

Optimization: issue rm in same code block as COPY #28

riazarbi opened this issue Aug 15, 2019 · 1 comment
Assignees

Comments

@riazarbi
Copy link
Collaborator

riazarbi commented Aug 15, 2019

RUN rm /oracle-instantclient18.3-basic-18.3.0.0.0-1.x86_64.rpm && \
is a rm command that is in a separate Docker RUN block from where you copy the file in to the build.

Because they are in separate code blocks, the rm command has no effect - it's in a new overlay that sits on top of the last one. In order to keep the image size down, any expansionary actions (such as copying in a large deb file) need to also have the rm command in the same Docker RUN operation.

I suggest combining these lines with a few nice 'n ugly \ && joins.

@riazarbi riazarbi self-assigned this Aug 15, 2019
@Gordonei
Copy link
Contributor

with enough indention, nothing is ugly (this is the rock upon which Python is built).

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

2 participants