Skip to content
This repository was archived by the owner on Apr 7, 2020. It is now read-only.

Commit bad1a6d

Browse files
Tobi Schäfermsokk
authored andcommitted
fix: regression in docker file according to best practices
see https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#run
1 parent cd7dce9 commit bad1a6d

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

Dockerfile

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,36 +18,44 @@ COPY .fonts.conf /root/.fonts.conf
1818

1919
# Install the packages needed to run Electron
2020
RUN sed -i 's/main/main contrib/g' /etc/apt/sources.list
21-
RUN apt-get -y update
22-
RUN apt-get -y upgrade
23-
RUN apt-get install -y unzip xvfb libgtk2.0-0 ttf-mscorefonts-installer libnotify4 libgconf2-4 libxss1 libnss3 dbus-x11
21+
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
22+
unzip \
23+
xvfb \
24+
libgtk2.0-0 \
25+
ttf-mscorefonts-installer \
26+
libnotify4 \
27+
libgconf2-4 \
28+
libxss1 \
29+
libnss3 \
30+
dbus-x11 \
31+
&& rm -rf /var/lib/apt/lists/*
2432

2533
# As the inline fonts should not change much put them before the app
2634
COPY fonts/* /usr/share/fonts/truetype/
2735

2836
# Install NodeJS
2937
RUN curl -sSL http://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
3038
RUN echo "deb http://deb.nodesource.com/node_10.x jessie main" > /etc/apt/sources.list.d/nodesource.list
31-
RUN apt-get -y update
32-
RUN apt-get -y install nodejs
39+
RUN apt-get update && apt-get install -y \
40+
nodejs \
41+
&& rm -rf /var/lib/apt/lists/* \
42+
&& rm -f /etc/apt/sources.list.d/nodesource.list
3343

3444
# Install dependencies
3545
COPY package.json /app/package.json
36-
RUN sed -i '/\"electron\"\:/d' ./package.json
37-
RUN npm install --production --no-optional
46+
RUN sed -i '/\"electron\"\:/d' ./package.json \
47+
&& npm install --production --no-optional
3848

3949
# Install Electron
4050
# You can define a different Electron version on build using the `--build-args electron_version=x.y.z` argument
4151
ARG electron_version=4.0.6
42-
RUN wget "https://github.com/atom/electron/releases/download/v${electron_version}/electron-v${electron_version}-linux-x64.zip" -O electron.zip
43-
RUN unzip electron.zip
44-
RUN rm electron.zip
52+
RUN wget "https://github.com/atom/electron/releases/download/v${electron_version}/electron-v${electron_version}-linux-x64.zip" -O electron.zip \
53+
&& unzip electron.zip \
54+
&& rm electron.zip
4555

4656
# Clean up
47-
RUN apt-get remove -y unzip nodejs
48-
RUN apt-get clean
49-
RUN rm -rf /var/lib/apt/lists/*
50-
RUN rm -f /etc/apt/sources.list.d/nodesource.list
57+
RUN apt-get remove -y unzip nodejs \
58+
&& apt-get clean
5159

5260
COPY . /app
5361

0 commit comments

Comments
 (0)