From 933c6ee3e31535da04f9be82c85ec9a98f6e28fc Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 7 May 2020 14:45:29 +0100 Subject: [PATCH 1/4] Use Xenial as the build image's base distribution Since Xenial has the oldest glibc (2.23) of all the active distributions, this attempts to construct a build image based on that. The Dockerfile here was built by recursively expanding the `FROM` lines until reaching `buildpack-deps:bionic-curl` and then changing that to `xenial`. Everything else is the same. Part of https://github.com/vector-im/riot-web/issues/13553 --- dockerbuild/Dockerfile | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/dockerbuild/Dockerfile b/dockerbuild/Dockerfile index 6ef8d0d..f123ce7 100644 --- a/dockerbuild/Dockerfile +++ b/dockerbuild/Dockerfile @@ -1,4 +1,42 @@ -FROM electronuserland/builder:12 +FROM buildpack-deps:xenial-curl + +ENV DEBIAN_FRONTEND noninteractive + +RUN curl -L https://yarnpkg.com/latest.tar.gz | tar xvz && mv yarn-* /yarn && ln -s /yarn/bin/yarn /usr/bin/yarn +RUN apt-get -qq update && apt-get -qq dist-upgrade && \ + # add repo for git-lfs + curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \ + # git ssh for using as docker image on CircleCI + # python for node-gyp + # rpm is required for FPM to build rpm package + # libsecret-1-dev and libgnome-keyring-dev are required even for prebuild keytar + apt-get -qq install --no-install-recommends qtbase5-dev bsdtar build-essential autoconf libssl-dev gcc-multilib g++-multilib lzip rpm python libcurl4 git git-lfs ssh unzip \ + libsecret-1-dev libgnome-keyring-dev \ + libopenjp2-tools && \ + # git-lfs + git lfs install && \ + apt-get purge -y --auto-remove && rm -rf /var/lib/apt/lists/* + +COPY test.sh /test.sh + +WORKDIR /project + +# fix error /usr/local/bundle/gems/fpm-1.5.0/lib/fpm/package/freebsd.rb:72:in `encode': "\xE2" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError) +# http://jaredmarkell.com/docker-and-locales/ +# http://askubuntu.com/a/601498 +ENV LANG C.UTF-8 +ENV LANGUAGE C.UTF-8 +ENV LC_ALL C.UTF-8 + +ENV DEBUG_COLORS true +ENV FORCE_COLOR true +ENV NODE_VERSION 12.16.1 + +# this package is used for snapcraft and we should not clear apt list - to avoid apt-get update during snap build +RUN curl -L https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz | tar xz -C /usr/local --strip-components=1 && \ + unlink /usr/local/CHANGELOG.md && unlink /usr/local/LICENSE && unlink /usr/local/README.md && \ + # https://github.com/npm/npm/issues/4531 + npm config set unsafe-perm true ENV RUSTUP_HOME=/usr/local/rustup \ CARGO_HOME=/usr/local/cargo \ From c1be3a760d6734ae4a6e0ebae6c9a45cba0ad927 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 7 May 2020 15:05:31 +0100 Subject: [PATCH 2/4] Attempt libcurl3 --- dockerbuild/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerbuild/Dockerfile b/dockerbuild/Dockerfile index f123ce7..a7870ba 100644 --- a/dockerbuild/Dockerfile +++ b/dockerbuild/Dockerfile @@ -10,7 +10,7 @@ RUN apt-get -qq update && apt-get -qq dist-upgrade && \ # python for node-gyp # rpm is required for FPM to build rpm package # libsecret-1-dev and libgnome-keyring-dev are required even for prebuild keytar - apt-get -qq install --no-install-recommends qtbase5-dev bsdtar build-essential autoconf libssl-dev gcc-multilib g++-multilib lzip rpm python libcurl4 git git-lfs ssh unzip \ + apt-get -qq install --no-install-recommends qtbase5-dev bsdtar build-essential autoconf libssl-dev gcc-multilib g++-multilib lzip rpm python libcurl3 git git-lfs ssh unzip \ libsecret-1-dev libgnome-keyring-dev \ libopenjp2-tools && \ # git-lfs From 5bca8b4c83b2dae492c3f3e02042a3eff6f5d3bf Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 7 May 2020 15:08:01 +0100 Subject: [PATCH 3/4] Remove test.sh --- dockerbuild/Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/dockerbuild/Dockerfile b/dockerbuild/Dockerfile index a7870ba..6ccfe3c 100644 --- a/dockerbuild/Dockerfile +++ b/dockerbuild/Dockerfile @@ -17,8 +17,6 @@ RUN apt-get -qq update && apt-get -qq dist-upgrade && \ git lfs install && \ apt-get purge -y --auto-remove && rm -rf /var/lib/apt/lists/* -COPY test.sh /test.sh - WORKDIR /project # fix error /usr/local/bundle/gems/fpm-1.5.0/lib/fpm/package/freebsd.rb:72:in `encode': "\xE2" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError) From 70c239f8d881d10ae544b62c7d81e95cf8ed9822 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 7 May 2020 17:46:19 +0100 Subject: [PATCH 4/4] Merge Seshat deps into a single apt-get --- dockerbuild/Dockerfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dockerbuild/Dockerfile b/dockerbuild/Dockerfile index 6ccfe3c..510363a 100644 --- a/dockerbuild/Dockerfile +++ b/dockerbuild/Dockerfile @@ -12,7 +12,9 @@ RUN apt-get -qq update && apt-get -qq dist-upgrade && \ # libsecret-1-dev and libgnome-keyring-dev are required even for prebuild keytar apt-get -qq install --no-install-recommends qtbase5-dev bsdtar build-essential autoconf libssl-dev gcc-multilib g++-multilib lzip rpm python libcurl3 git git-lfs ssh unzip \ libsecret-1-dev libgnome-keyring-dev \ - libopenjp2-tools && \ + libopenjp2-tools \ + # Used by Seshat + libsqlcipher-dev && \ # git-lfs git lfs install && \ apt-get purge -y --auto-remove && rm -rf /var/lib/apt/lists/* @@ -40,7 +42,4 @@ ENV RUSTUP_HOME=/usr/local/rustup \ CARGO_HOME=/usr/local/cargo \ PATH=/usr/local/cargo/bin:$PATH -RUN apt-get update && \ - apt-get install -y libsqlcipher-dev && \ - rm -rf /var/lib/apt/lists/* && \ - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --profile minimal +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --profile minimal