Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Merge ENV statements to reduce amount of layers #571

Closed
felipecrs opened this issue Sep 21, 2020 · 2 comments
Closed

Merge ENV statements to reduce amount of layers #571

felipecrs opened this issue Sep 21, 2020 · 2 comments
Labels
info-needed Issue requires more information from poster

Comments

@felipecrs
Copy link
Contributor

felipecrs commented Sep 21, 2020

If we see for example the documentation about the Node script, it says:

ENV NVM_DIR="/usr/local/share/nvm"
ENV NVM_SYMLINK_CURRENT=true \
    PATH=${NVM_DIR}/current/bin:${PATH}

But it could be simplified to:

ENV NVM_DIR="/usr/local/share/nvm" \
    NVM_SYMLINK_CURRENT=true \
    PATH=${NVM_DIR}/current/bin:${PATH}

In order to reduce the amount of the layers in the Docker image.

This could possibly be applied to all the Dockerfiles and the scripts docs.

@Chuxel
Copy link
Member

Chuxel commented Sep 21, 2020

@felipecrs This doesn't work because NVM_DIR is used in the path, and therefore is not defined in the second example. Did this first and reverted because of it.

@Chuxel Chuxel added the info-needed Issue requires more information from poster label Sep 21, 2020
@felipecrs
Copy link
Contributor Author

You're totally right, I tested before and I thought that it worked in the same ENV statement, but now I tested again and it does not work.

image

Sorry for the confusion.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants