From dcdcea55e671614d2a60c27f95fcff86bad6467b Mon Sep 17 00:00:00 2001 From: Alex Brazier Date: Mon, 8 May 2017 23:23:02 +0100 Subject: [PATCH 1/4] Improved dockerfile, and added alpine version --- .dockerignore | 7 +++++++ Dockerfile | 20 ++++++++++++-------- Dockerfile-alpine | 17 +++++++++++++++++ 3 files changed, 36 insertions(+), 8 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile-alpine diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..64b8f28ccf --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +.git +test +Dockerfile* +.gitignore +.dockerignore +.travis.yml +*.md diff --git a/Dockerfile b/Dockerfile index 13b0918e58..0f0f13a06a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,21 @@ - FROM ruby:2.4.1 MAINTAINER Conor Heine -RUN apt-get update -RUN apt-get -y install git nodejs -COPY . /devdocs -RUN gem install bundler - WORKDIR /devdocs +RUN apt-get update && \ + apt-get -y install git nodejs && \ + gem install bundler + +COPY Gemfile Gemfile.lock Rakefile /devdocs/ + RUN bundle install --system -RUN thor docs:download --all + +COPY . /devdocs + +RUN thor docs:download --all && \ + thor assets:compile && \ + rm -rf /tmp EXPOSE 9292 CMD rackup -o 0.0.0.0 - diff --git a/Dockerfile-alpine b/Dockerfile-alpine new file mode 100644 index 0000000000..35526846f3 --- /dev/null +++ b/Dockerfile-alpine @@ -0,0 +1,17 @@ +FROM ruby:2.4.1-alpine +MAINTAINER Conor Heine + +WORKDIR /devdocs + +COPY . /devdocs + +RUN apk --update add nodejs build-base libstdc++ gzip git zlib-dev && \ + gem install bundler && \ + bundle install --system --without test && \ + thor docs:download --all && \ + thor assets:compile && \ + apk del gzip build-base git zlib-dev && \ + rm -rf /var/cache/apk/* && rm -rf /tmp && rm -rf ~/.gem + +EXPOSE 9292 +CMD rackup -o 0.0.0.0 From 61759c9a510a32699ca5d55484f9bec5d7531c5a Mon Sep 17 00:00:00 2001 From: Alex Brazier Date: Sat, 13 May 2017 14:54:06 +0100 Subject: [PATCH 2/4] Delete more unnecessary files from docker images --- Dockerfile | 6 ++++-- Dockerfile-alpine | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0f0f13a06a..d4ec6f9e83 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,11 +5,13 @@ WORKDIR /devdocs RUN apt-get update && \ apt-get -y install git nodejs && \ - gem install bundler + gem install bundler && \ + rm -rf /var/lib/apt/lists/* COPY Gemfile Gemfile.lock Rakefile /devdocs/ -RUN bundle install --system +RUN bundle install --system && \ + rm -rf ~/.gem /root/.bundle/cache /usr/local/bundle/cache COPY . /devdocs diff --git a/Dockerfile-alpine b/Dockerfile-alpine index 35526846f3..f85a632256 100644 --- a/Dockerfile-alpine +++ b/Dockerfile-alpine @@ -11,7 +11,8 @@ RUN apk --update add nodejs build-base libstdc++ gzip git zlib-dev && \ thor docs:download --all && \ thor assets:compile && \ apk del gzip build-base git zlib-dev && \ - rm -rf /var/cache/apk/* && rm -rf /tmp && rm -rf ~/.gem + rm -rf /var/cache/apk/* /tmp ~/.gem /root/.bundle/cache \ + /usr/local/bundle/cache /usr/lib/node_modules EXPOSE 9292 CMD rackup -o 0.0.0.0 From 8291d39e6c43dcb57b2870b201306b54a6d76971 Mon Sep 17 00:00:00 2001 From: Alex Brazier Date: Mon, 15 May 2017 22:19:42 +0100 Subject: [PATCH 3/4] Remove maintainer form dockerfile --- Dockerfile | 1 - Dockerfile-alpine | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index d4ec6f9e83..314f62534a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ FROM ruby:2.4.1 -MAINTAINER Conor Heine WORKDIR /devdocs diff --git a/Dockerfile-alpine b/Dockerfile-alpine index f85a632256..dbca43cb5b 100644 --- a/Dockerfile-alpine +++ b/Dockerfile-alpine @@ -1,5 +1,4 @@ FROM ruby:2.4.1-alpine -MAINTAINER Conor Heine WORKDIR /devdocs @@ -7,7 +6,7 @@ COPY . /devdocs RUN apk --update add nodejs build-base libstdc++ gzip git zlib-dev && \ gem install bundler && \ - bundle install --system --without test && \ + bundle install --system --without test --no-document && \ thor docs:download --all && \ thor assets:compile && \ apk del gzip build-base git zlib-dev && \ From c98c31083d03cc3b541c2e1a9b6c2fd332141e5e Mon Sep 17 00:00:00 2001 From: Alex Brazier Date: Thu, 18 May 2017 10:54:19 +0100 Subject: [PATCH 4/4] Fix bug in alpine dockerfile --- Dockerfile-alpine | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile-alpine b/Dockerfile-alpine index dbca43cb5b..ecbe582892 100644 --- a/Dockerfile-alpine +++ b/Dockerfile-alpine @@ -6,7 +6,7 @@ COPY . /devdocs RUN apk --update add nodejs build-base libstdc++ gzip git zlib-dev && \ gem install bundler && \ - bundle install --system --without test --no-document && \ + bundle install --system --without test && \ thor docs:download --all && \ thor assets:compile && \ apk del gzip build-base git zlib-dev && \