Skip to content

Commit

Permalink
Refactoring of Dockerfile
Browse files Browse the repository at this point in the history
- reorganized the libraries for better readability
- added logic to clean-up apt-cache after fetch inorder to shrink layer
size; in-line with Docker best practices
  • Loading branch information
conz27 authored and droidmonkey committed Jan 29, 2019
1 parent d74c8a3 commit c682b48
Showing 1 changed file with 19 additions and 28 deletions.
47 changes: 19 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,44 +24,45 @@ ENV TERM=xterm-256color

RUN set -x \
&& apt-get update -y \
&& apt-get -y install software-properties-common
&& apt-get -y install software-properties-common \
&& rm -rf /var/lib/apt/lists/*

RUN set -x \
&& add-apt-repository ppa:beineri/opt-${QT5_PPA_VERSION}-trusty \
&& add-apt-repository ppa:phoerious/keepassxc

RUN set -x \
&& apt-get update -y \
&& apt-get upgrade -y

# build and runtime dependencies
RUN set -x \
&& apt-get update -y \
&& apt-get upgrade -y \
&& apt-get install -y \
cmake3 \
curl \
g++ \
git \
libgcrypt20-18-dev \
libargon2-0-dev \
libsodium-dev \
libcurl-no-gcrypt-dev \
libfuse2 \
libgcrypt20-18-dev \
libqrencode-dev \
libsodium-dev \
libxi-dev \
libxtst-dev \
libyubikey-dev \
libykpers-1-dev \
mesa-common-dev \
xclip \
xvfb \
zlib1g-dev \
# ubuntu:14.04 has no quazip, put here as placeholder
# libquazip5-dev
${QT5_VERSION}base \
${QT5_VERSION}tools \
${QT5_VERSION}x11extras \
${QT5_VERSION}translations \
${QT5_VERSION}imageformats \
${QT5_VERSION}svg \
zlib1g-dev \
libxi-dev \
libxtst-dev \
# ubuntu:14.04 has no quazip (it's optional)
# libquazip5-dev \
mesa-common-dev \
libyubikey-dev \
libykpers-1-dev \
libqrencode-dev \
xclip \
xvfb
&& rm -rf /var/lib/apt/lists/*

ENV PATH="/opt/${QT5_VERSION}/bin:${PATH}"
ENV CMAKE_PREFIX_PATH="/opt/${QT5_VERSION}/lib/cmake"
Expand All @@ -74,12 +75,6 @@ RUN set -x \
&& echo "/opt/${QT5_VERSION}/lib" > /etc/ld.so.conf.d/${QT5_VERSION}.conf \
&& echo "/opt/keepassxc-libs/lib/x86_64-linux-gnu" > /etc/ld.so.conf.d/keepassxc.conf

# AppImage dependencies
RUN set -x \
&& apt-get install -y \
curl \
libfuse2

RUN set -x \
&& curl -L "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" > /usr/bin/linuxdeploy \
&& curl -L "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" > /usr/bin/linuxdeploy-plugin-qt \
Expand All @@ -88,10 +83,6 @@ RUN set -x \
&& chmod +x /usr/bin/linuxdeploy-plugin-qt \
&& chmod +x /usr/bin/appimagetool

RUN set -x \
&& apt-get autoremove --purge \
&& rm -rf /var/lib/apt/lists/*

VOLUME /keepassxc/src
VOLUME /keepassxc/out
WORKDIR /keepassxc

0 comments on commit c682b48

Please sign in to comment.