From ab60aa226617c62161bf56d1bb45cea76cfb8403 Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Fri, 4 Aug 2017 01:04:36 +0900 Subject: Use GNU libiconv in Nokogiri (#4494) System default libiconv of Alpine Linux only supports some charset (e.g. UTF-8). Therefore, the preview card of the page which is not UTF-8 will be broken in the Docker environment. Using GNU libiconv! --- Dockerfile | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index ef139dcec..93a8ffd0b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,9 @@ ENV UID=991 GID=991 \ RAILS_SERVE_STATIC_FILES=true \ RAILS_ENV=production NODE_ENV=production +ARG LIBICONV_VERSION=1.15 +ARG LIBICONV_DOWNLOAD_SHA256=ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc8913178 + EXPOSE 3000 4000 WORKDIR /mastodon @@ -18,8 +21,7 @@ RUN echo "@edge https://nl.alpinelinux.org/alpine/edge/main" >> /etc/apk/reposit build-base \ icu-dev \ libidn-dev \ - libxml2-dev \ - libxslt-dev \ + libtool \ postgresql-dev \ protobuf-dev \ python \ @@ -32,8 +34,6 @@ RUN echo "@edge https://nl.alpinelinux.org/alpine/edge/main" >> /etc/apk/reposit imagemagick@edge \ libidn \ libpq \ - libxml2 \ - libxslt \ nodejs-npm@edge \ nodejs@edge \ protobuf \ @@ -41,11 +41,23 @@ RUN echo "@edge https://nl.alpinelinux.org/alpine/edge/main" >> /etc/apk/reposit tini \ yarn@edge \ && update-ca-certificates \ + && wget -O libiconv.tar.gz "http://ftp.gnu.org/pub/gnu/libiconv/libiconv-$LIBICONV_VERSION.tar.gz" \ + && echo "$LIBICONV_DOWNLOAD_SHA256 *libiconv.tar.gz" | sha256sum -c - \ + && mkdir -p /tmp/src \ + && tar -xzf libiconv.tar.gz -C /tmp/src \ + && rm libiconv.tar.gz \ + && cd /tmp/src/libiconv-$LIBICONV_VERSION \ + && ./configure --prefix=/usr/local \ + && make \ + && make install \ + && libtool --finish /usr/local/lib \ + && cd /mastodon \ && rm -rf /tmp/* /var/cache/apk/* COPY Gemfile Gemfile.lock package.json yarn.lock /mastodon/ -RUN bundle install --deployment --without test development \ +RUN bundle config build.nokogiri --with-iconv-lib=/usr/local/lib --with-iconv-include=/usr/local/include \ + && bundle install --deployment --without test development \ && yarn --ignore-optional --pure-lockfile COPY . /mastodon -- cgit From 5d408fd9aa76f9ef3d559a377bccbcece998fbfa Mon Sep 17 00:00:00 2001 From: Thomas Leister Date: Mon, 7 Aug 2017 18:55:07 +0200 Subject: [Docker] Add multicore support to "make" and "bundler" (#4544) * Let make and bundler use multiple cores * Adds -j option to bundle install instead of bundle config --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 93a8ffd0b..398628a48 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,7 +48,7 @@ RUN echo "@edge https://nl.alpinelinux.org/alpine/edge/main" >> /etc/apk/reposit && rm libiconv.tar.gz \ && cd /tmp/src/libiconv-$LIBICONV_VERSION \ && ./configure --prefix=/usr/local \ - && make \ + && make -j$(getconf _NPROCESSORS_ONLN)\ && make install \ && libtool --finish /usr/local/lib \ && cd /mastodon \ @@ -57,7 +57,7 @@ RUN echo "@edge https://nl.alpinelinux.org/alpine/edge/main" >> /etc/apk/reposit COPY Gemfile Gemfile.lock package.json yarn.lock /mastodon/ RUN bundle config build.nokogiri --with-iconv-lib=/usr/local/lib --with-iconv-include=/usr/local/include \ - && bundle install --deployment --without test development \ + && bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --without test development \ && yarn --ignore-optional --pure-lockfile COPY . /mastodon -- cgit