-
Notifications
You must be signed in to change notification settings - Fork 1.4k
refactor file to take better account of layers. #70
Changes from all commits
27600c4
0848096
0aa8765
7db43f8
963ef57
bd66218
ba1060e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,33 +5,22 @@ | |
|
||
FROM node:lts | ||
|
||
# Configure apt | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update \ | ||
&& apt-get -y install --no-install-recommends apt-utils 2>&1 | ||
|
||
# Verify git and needed tools are installed | ||
RUN apt-get install -y git procps | ||
ENV DEBIAN_FRONTEND=dialog | ||
ENV SHELL /bin/bash | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does not seem a necessary optimization as we have been using a standard template for creating Dockerfiles for dev containers. You can find the standard template in the repository and it seems very easy, maintainable and clean in future using the standard template for all the dev containers 😄 |
||
|
||
# Remove outdated yarn from /opt and install via package | ||
# so it can be easily updated via apt-get upgrade yarn | ||
RUN rm -rf /opt/yarn-* \ | ||
RUN apt-get update \ | ||
&& apt-get -y install --no-install-recommends apt-utils 2>&1 \ | ||
&& apt-get install -y git procps \ | ||
&& rm -rf /opt/yarn-* \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Merging all the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think as long as we can make it clear with comments and the "&&" being before the line so people can see that it is a continuation, we are probably okay here. The main concern is getting things so it is "cut-and-pasteable" into another definition. That was my main comment on that point here. It makes it clearer that the commands are a continuation of a broader command. |
||
&& rm -f /usr/local/bin/yarn \ | ||
&& rm -f /usr/local/bin/yarnpkg \ | ||
&& apt-get install -y curl apt-transport-https lsb-release \ | ||
&& curl -sS https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/pubkey.gpg | apt-key add - 2>/dev/null \ | ||
&& echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ | ||
&& apt-get update \ | ||
&& apt-get -y install --no-install-recommends yarn | ||
|
||
# Install eslint | ||
RUN npm install -g eslint | ||
|
||
# Clean up | ||
RUN apt-get autoremove -y \ | ||
&& apt-get -y install --no-install-recommends yarn \ | ||
&& npm install -g eslint \ | ||
&& apt-get autoremove -y \ | ||
&& apt-get clean -y \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
ENV DEBIAN_FRONTEND=dialog | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shifting this layer, as mentioned earlier does not contribute to the purpose. |
||
|
||
# Set the default shell to bash instead of sh | ||
ENV SHELL /bin/bash | ||
&& rm -rf /var/lib/apt/lists/* \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not contribute to the purpose of using
ENV DEBIAN_FRONTEND=noninteractive
as you are trying to reassign immediately withdialog
. We are using noninteractive because the following layers as per the original Dockerfile should run without user intervention.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not sure about this either