Cleanup Dockerfile. NFC. (#569)

- Remove unnecessary dependencies from build stage.
- Move binutils installation to first layer.
- Adjust indents and spacing.
- Merge ENV declarations into a single line.
- Split apt-get commands over multiple lines
This commit is contained in:
Kleis Auke Wolthuizen
2020-07-25 20:04:20 +02:00
committed by GitHub
parent b5077e4642
commit de08462b17

View File

@@ -6,17 +6,16 @@ ENV EMSDK /emsdk
# ------------------------------------------------------------------------------
RUN echo "## Start building" \
\
&& echo "## Update and install packages" \
&& apt-get -qq -y update \
&& apt-get -qq install -y --no-install-recommends \
libxml2 \
wget \
git-core \
ca-certificates \
binutils \
build-essential \
ca-certificates \
file \
python3 python3-pip \
git \
python3 \
python3-pip \
&& echo "## Done"
RUN echo "## Get EMSDK" \
@@ -36,10 +35,8 @@ RUN cd ${EMSDK} \
&& cat ${EMSDK}/upstream/emscripten/cache/sanity.txt \
&& echo "## Done"
# Clean up emscripten installation and strip some symbols
RUN echo "## Aggresive optimization: Remove debug symbols" \
&& apt-get -qq -y update && apt-get -qq install -y --no-install-recommends \
binutils \
# Cleanup Emscripten installation and strip some symbols
RUN echo "## Aggressive optimization: Remove debug symbols" \
&& cd ${EMSDK} && . ./emsdk_env.sh \
# Remove debugging symbols from embedded node (extra 7MB)
&& strip -s `which node` \
@@ -62,10 +59,10 @@ COPY --from=stage_build /emsdk /emsdk
# Fallback in case Emscripten isn't activated.
# This will let use tools offered by this image inside other Docker images
# (sub-stages) or with custom / no entrypoint
ENV EMSDK_NODE=/emsdk/node/12.18.1_64bit/bin/node
ENV EMSDK=/emsdk
ENV EM_CONFIG=/emsdk/.emscripten
ENV PATH="${EMSDK}:${EMSDK}/upstream/emscripten:${EMSDK}/upstream/bin:emsdk/node/12.18.1_64bit/bin:${PATH}"
ENV EMSDK=/emsdk \
EM_CONFIG=/emsdk/.emscripten \
EMSDK_NODE=/emsdk/node/12.18.1_64bit/bin/node \
PATH="/emsdk:/emsdk/upstream/emscripten:/emsdk/upstream/bin:/emsdk/node/12.18.1_64bit/bin:${PATH}"
# ------------------------------------------------------------------------------
# Create a 'standard` 1000:1000 user
@@ -87,8 +84,8 @@ RUN echo "## Create emscripten user (1000:1000)" \
RUN echo "## Update and install packages" \
# mitigate problem with create symlink to man for base debian image
&& mkdir -p /usr/share/man/man1/ \
\
&& apt-get -qq -y update && apt-get -qq install -y --no-install-recommends \
&& apt-get -qq -y update \
&& apt-get -qq install -y --no-install-recommends \
libxml2 \
ca-certificates \
python3 \
@@ -105,7 +102,6 @@ RUN echo "## Update and install packages" \
libidn11 \
cmake \
openjdk-11-jre-headless \
\
# Standard Cleanup on Debian images
&& apt-get -y clean \
&& apt-get -y autoclean \