From 561c9ac969c8c8ffbd91639169d0c5f14b012b58 Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Fri, 7 Jul 2017 16:21:27 +0100 Subject: [PATCH] Dockerfile.dev having more build layers Building an image is slow, this change helps developers to reduce image build time by making it easier to build only one sdk or reorder sdks building to avoid affecting the incremental build. --- Dockerfile.dev | 33 ++++++++++++++++++++++++++++++--- README.md | 7 +++++++ 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/Dockerfile.dev b/Dockerfile.dev index d4177dbd..b84c11ee 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -12,9 +12,36 @@ ENV PATH $GOPATH/bin:$GOROOT/bin:$PATH WORKDIR /mint -COPY . /mint +RUN apt-get update && apt-get install -yq git jq curl -RUN apt-get update && apt-get install -yq git jq && \ - /mint/build/install.sh +COPY run /mint/run + +COPY build/data/ /mint/build/data/ +RUN /mint/build/data/install.sh + +COPY build/cli/ /mint/build/cli/ +RUN /mint/build/cli/install.sh + +COPY build/go/ /mint/build/go/ +RUN /mint/build/go/install.sh + +COPY build/java/ /mint/build/java/ +RUN /mint/build/java/install.sh + +COPY build/py/ /mint/build/py/ +RUN /mint/build/py/install.sh + +COPY build/js/ /mint/build/js/ +RUN /mint/build/js/install.sh + +COPY build/php/ /mint/build/php/ +RUN /mint/build/php/install.sh + +COPY build/ruby/ /mint/build/ruby/ +RUN /mint/build/ruby/install.sh + +COPY run.sh /mint/run.sh +COPY tests.sh /mint/tests.sh CMD ["/mint/run.sh", "/mint/tests.sh"] + diff --git a/README.md b/README.md index 5ef1d00f..24af29d1 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,13 @@ $ cd mint $ docker build -t minio/mint . ``` +Developers can also customize `Dockerfile.dev` to generate smaller build images. For example, removing the following lines from `Dockerfile.dev` will avoid shipping Golang SDK tests in the image hence a faster build and tests execution time. + +```docker +COPY build/go/ /mint/build/go/ +RUN /mint/build/go/install.sh +``` + ### Build using Travis Each pull request when submitted to Github `travis-ci` runs build on mint to create new docker image on `play.minio.io`, our private docker registry. You can get the `mint` image associated with your pull request by just running `docker pull play.minio.io/mint:$PULL_REQUEST_SHA`