This is an automated email from the ASF dual-hosted git repository.

kszucs pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 4107529  ARROW-4909: [CI] Use hadolint to lint Dockerfiles
4107529 is described below

commit 4107529a53ae13686e09bda636737e2f4c0797aa
Author: Krisztián Szűcs <[email protected]>
AuthorDate: Mon Mar 18 17:31:32 2019 +0100

    ARROW-4909: [CI] Use hadolint to lint Dockerfiles
    
    Author: Krisztián Szűcs <[email protected]>
    Author: Uwe L. Korn <[email protected]>
    
    Closes #3944 from xhochy/ARROW-4909 and squashes the following commits:
    
    74ed3055 <Krisztián Szűcs> name pre commit hooks
    c97b24ed <Uwe L. Korn> ARROW-4909:  Use hadolint to lint Dockerfiles
---
 csharp/build/docker/Dockerfile => .hadolint.yaml   | 10 ++++------
 .pre-commit-config.yaml                            | 15 ++++++++++++---
 .travis.yml                                        |  2 +-
 c_glib/Dockerfile                                  | 19 ++++++++++++-------
 .../Dockerfile => ci/docker_build_and_test_cpp.sh  | 11 ++++++-----
 .../docker_build_and_test_python.sh                | 10 +++++-----
 ci/travis_lint.sh                                  |  7 +++++++
 cpp/Dockerfile                                     | 15 ++++++++-------
 cpp/Dockerfile.alpine                              |  8 ++++----
 cpp/Dockerfile.debian-testing                      |  8 ++++----
 cpp/Dockerfile.fedora                              |  2 +-
 cpp/Dockerfile.ubuntu-bionic                       | 22 +++++++++++-----------
 cpp/Dockerfile.ubuntu-xenial                       | 22 ++++++++++++----------
 csharp/build/docker/Dockerfile                     |  6 +++---
 docs/Dockerfile                                    |  6 ++----
 go/Dockerfile                                      | 11 +++++------
 integration/dask/Dockerfile                        |  8 ++------
 integration/hdfs/Dockerfile                        | 12 +++++++-----
 integration/spark/Dockerfile                       | 10 ++++++----
 java/Dockerfile                                    |  9 ++++++---
 js/Dockerfile                                      | 12 ++++++------
 python/Dockerfile                                  |  6 ++----
 python/Dockerfile.alpine                           | 12 ++++++------
 r/Dockerfile                                       |  4 ++--
 rust/Dockerfile                                    |  4 ++--
 25 files changed, 136 insertions(+), 115 deletions(-)

diff --git a/csharp/build/docker/Dockerfile b/.hadolint.yaml
similarity index 89%
copy from csharp/build/docker/Dockerfile
copy to .hadolint.yaml
index e6ad574..33190e8 100644
--- a/csharp/build/docker/Dockerfile
+++ b/.hadolint.yaml
@@ -15,9 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-FROM microsoft/dotnet/2.1-sdk
-
-ADD csharp /arrow/csharp
-WORKDIR /arrow/csharp
-
-CMD dotnet build
\ No newline at end of file
+ignored:
+  - DL3008
+  - DL3013
+  - DL3018
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 8823164..d72b126 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -24,13 +24,13 @@ repos:
   - repo: local
     hooks:
       - id: rat
-        name: rat
+        name: Release Audit Tool
         language: system
         entry: bash -c "git archive HEAD --prefix=apache-arrow/ 
--output=arrow-src.tar && ./dev/release/run-rat.sh arrow-src.tar"
         always_run: true
         pass_filenames: false
       - id: rustfmt
-        name: rustfmt
+        name: Rust Format
         language: system
         entry: bash -c "cd rust && cargo +stable fmt --all -- --check"
         files: ^rust/.*\.rs$
@@ -38,20 +38,29 @@ repos:
           - file
           - rust
       - id: cmake-format
-        name: cmake-format
+        name: CMake Format
         language: python
         entry: bash -c "pip install cmake-format && python run-cmake-format.py 
--check"
         entry: echo
         files: ^(.*/CMakeLists.txt|.*.cmake)$
+      - id: hadolint
+        name: Docker Format
+        language: docker_image
+        types:
+         - dockerfile
+        entry: --entrypoint /bin/hadolint hadolint/hadolint:latest -
+        exclude: ^dev/.*$
   - repo: git://github.com/pre-commit/pre-commit-hooks
     sha: v1.2.3
     hooks:
      - id: flake8
+       name: Python Format
        files: ^(python|crossbow|integration)/
        types:
          - file
          - python
      - id: flake8
+       name: Cython Format
        files: ^python/
        types:
          - file
diff --git a/.travis.yml b/.travis.yml
index ea4d609..f5b6fd7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -46,7 +46,7 @@ before_install:
 matrix:
   fast_finish: true
   include:
-  - name: "Lint C++, Python, R"
+  - name: "Lint C++, Python, R, Docker"
     os: linux
     language: python
     python: "3.6"
diff --git a/c_glib/Dockerfile b/c_glib/Dockerfile
index 7abfa17..163db7f 100644
--- a/c_glib/Dockerfile
+++ b/c_glib/Dockerfile
@@ -17,14 +17,19 @@
 
 FROM arrow:cpp
 
-RUN apt-get -q install --no-install-recommends -y \
-        ruby-dev \
-        pkg-config \
+RUN apt-get update -y -q && \
+    apt-get -q install --no-install-recommends -y \
         autoconf-archive \
+        gobject-introspection \
         gtk-doc-tools \
-        libgirepository1.0-dev
+        libgirepository1.0-dev \
+        libglib2.0-dev \
+        pkg-config \
+        ruby-dev \
+    && apt-get clean \
+    && rm -rf /var/lib/apt/lists/*
 
-ADD c_glib/Gemfile /arrow/c_glib/
+COPY c_glib/Gemfile /arrow/c_glib/
 RUN conda install meson=0.47.1 && \
     conda clean --all && \
     gem install bundler && \
@@ -39,6 +44,6 @@ ENV ARROW_BUILD_TESTS=OFF \
     GI_TYPELIB_PATH="${CONDA_PREFIX}/lib/girepository-1.0"
 
 # build, install and test
-CMD arrow/ci/docker_build_cpp.sh && \
+CMD ["/bin/bash", "-c", "arrow/ci/docker_build_cpp.sh && \
     arrow/ci/docker_build_c_glib.sh && \
-    arrow/c_glib/test/run-test.rb
+    arrow/c_glib/test/run-test.rb"]
diff --git a/csharp/build/docker/Dockerfile b/ci/docker_build_and_test_cpp.sh
old mode 100644
new mode 100755
similarity index 89%
copy from csharp/build/docker/Dockerfile
copy to ci/docker_build_and_test_cpp.sh
index e6ad574..ff33221
--- a/csharp/build/docker/Dockerfile
+++ b/ci/docker_build_and_test_cpp.sh
@@ -1,3 +1,4 @@
+#!/usr/bin/env bash
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -15,9 +16,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-FROM microsoft/dotnet/2.1-sdk
+set -e
 
-ADD csharp /arrow/csharp
-WORKDIR /arrow/csharp
-
-CMD dotnet build
\ No newline at end of file
+/arrow/ci/docker_build_cpp.sh
+pushd /build/cpp
+ninja test
+popd
diff --git a/csharp/build/docker/Dockerfile b/ci/docker_build_and_test_python.sh
old mode 100644
new mode 100755
similarity index 87%
copy from csharp/build/docker/Dockerfile
copy to ci/docker_build_and_test_python.sh
index e6ad574..ce555b7
--- a/csharp/build/docker/Dockerfile
+++ b/ci/docker_build_and_test_python.sh
@@ -1,3 +1,4 @@
+#!/usr/bin/env bash
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -15,9 +16,8 @@
 # specific language governing permissions and limitations
 # under the License.
 
-FROM microsoft/dotnet/2.1-sdk
+set -e
 
-ADD csharp /arrow/csharp
-WORKDIR /arrow/csharp
-
-CMD dotnet build
\ No newline at end of file
+/arrow/ci/docker_build_cpp.sh
+/arrow/ci/docker_build_python.sh
+pytest -v --pyargs pyarrow
diff --git a/ci/travis_lint.sh b/ci/travis_lint.sh
index f99a7f2..1c36eaf 100755
--- a/ci/travis_lint.sh
+++ b/ci/travis_lint.sh
@@ -23,6 +23,13 @@ set -ex
 export ARROW_TRAVIS_USE_TOOLCHAIN=0
 source $TRAVIS_BUILD_DIR/ci/travis_env_common.sh
 
+pip install pre_commit
+pre-commit install
+
+# TODO: Move more checks into pre-commit as this gives a nice summary
+# and doesn't abort on the first failed check.
+pre-commit run hadolint -a
+
 # CMake formatting check
 pip install cmake_format
 $TRAVIS_BUILD_DIR/run-cmake-format.py --check
diff --git a/cpp/Dockerfile b/cpp/Dockerfile
index 0b177af..a570047 100644
--- a/cpp/Dockerfile
+++ b/cpp/Dockerfile
@@ -29,16 +29,18 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
         ninja-build \
         pkg-config \
         tzdata \
-        wget
+        wget \
+    && apt-get clean \
+    && rm -rf /var/lib/apt/lists/*
 
 # install conda and required packages
 ARG EXTRA_CONDA_PKGS
 ENV PATH=/opt/conda/bin:$PATH \
     CONDA_PREFIX=/opt/conda
-ADD ci/docker_install_conda.sh \
-    ci/conda_env_cpp.yml \
-    ci/conda_env_unix.yml \
-    /arrow/ci/
+COPY ci/docker_install_conda.sh \
+     ci/conda_env_cpp.yml \
+     ci/conda_env_unix.yml \
+     /arrow/ci/
 RUN arrow/ci/docker_install_conda.sh && \
     conda install -q -c conda-forge \
         --file arrow/ci/conda_env_cpp.yml \
@@ -55,5 +57,4 @@ ENV CC=gcc \
     PARQUET_HOME=$CONDA_PREFIX
 
 # build and test
-CMD arrow/ci/docker_build_cpp.sh && \
-    cd /build/cpp && ninja test
+CMD ["arrow/ci/docker_build_and_test_cpp.sh"]
diff --git a/cpp/Dockerfile.alpine b/cpp/Dockerfile.alpine
index 9cef438..a87c628 100644
--- a/cpp/Dockerfile.alpine
+++ b/cpp/Dockerfile.alpine
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-FROM alpine
+FROM alpine:3.9
 
 # Install basic build dependencies
 # grpc requires libnsl-dev to be present, this cannot be installed via a 
bundle.
@@ -41,14 +41,14 @@ RUN apk add --no-cache -q \
 
 # Ganidva is deactivated as we don't support building LLVM via ExternalProject
 # and Alpine only has LLVM 6 in its repositories yet.
+# ARROW-4917: ORC fails with compiler problems
 ENV CC=gcc \
     CXX=g++ \
     ARROW_GANDIVA=OFF \
-    ARROW_ORC=ON \
+    ARROW_ORC=OFF \
     ARROW_PARQUET=ON \
     ARROW_BUILD_TESTS=ON \
     ARROW_HOME=/usr/local
 
 # build and test
-CMD arrow/ci/docker_build_cpp.sh && \
-    cd /build/cpp && ninja test
+CMD ["arrow/ci/docker_build_and_test_cpp.sh"]
diff --git a/cpp/Dockerfile.debian-testing b/cpp/Dockerfile.debian-testing
index 1b4729e..52d2037 100644
--- a/cpp/Dockerfile.debian-testing
+++ b/cpp/Dockerfile.debian-testing
@@ -57,7 +57,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
         rapidjson-dev \
         thrift-compiler \
         tzdata \
-        wget
+        wget \
+    && apt-get clean \
+    && rm -rf /var/lib/apt/lists/*
 
 ENV CC=gcc \
      CXX=g++ \
@@ -71,6 +73,4 @@ ENV CC=gcc \
      CMAKE_ARGS="-DFlatbuffers_SOURCE=BUNDLED -Dc-ares_SOURCE=BUNDLED 
-DgRPC_SOURCE=BUNDLED"
 
 # build and test
-CMD arrow/ci/docker_build_cpp.sh && \
-    cd /build/cpp && ctest -j2 --output-on-failure -L unittest
-
+CMD ["arrow/ci/docker_build_and_test_cpp.sh"]
diff --git a/cpp/Dockerfile.fedora b/cpp/Dockerfile.fedora
index d9da9f7..bb7946f 100644
--- a/cpp/Dockerfile.fedora
+++ b/cpp/Dockerfile.fedora
@@ -73,4 +73,4 @@ ENV CC=gcc \
      CMAKE_ARGS="-DgRPC_SOURCE=BUNDLED"
 
 # build; tests don't work on Fedora at the moment due to compiler problems in 
gcc 8.2 (fixed in 8.3)
-CMD arrow/ci/docker_build_cpp.sh
+CMD ["arrow/ci/docker_build_cpp.sh"]
diff --git a/cpp/Dockerfile.ubuntu-bionic b/cpp/Dockerfile.ubuntu-bionic
index a7c5c44..4e2620f 100644
--- a/cpp/Dockerfile.ubuntu-bionic
+++ b/cpp/Dockerfile.ubuntu-bionic
@@ -17,13 +17,13 @@
 
 FROM ubuntu:bionic
 
-# install build essentials
-RUN export DEBIAN_FRONTEND=noninteractive && \
-    apt-get update -y -q && \
-    apt-get install -y wget software-properties-common
-RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
-RUN apt-add-repository -y "deb http://apt.llvm.org/bionic/ 
llvm-toolchain-bionic-7 main"
-RUN export DEBIAN_FRONTEND=noninteractive && \
+SHELL ["/bin/bash", "-o", "pipefail", "-c"]
+
+ENV DEBIAN_FRONTEND noninteractive
+RUN apt-get update -y -q && \
+    apt-get install -y -q --no-install-recommends wget 
software-properties-common gpg-agent && \
+    wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
+    apt-add-repository -y "deb http://apt.llvm.org/bionic/ 
llvm-toolchain-bionic-7 main" && \
     apt-get update -y -q && \
     apt-get install -y -q --no-install-recommends \
         autoconf \
@@ -60,7 +60,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
         protobuf-compiler \
         protobuf-compiler-grpc \
         rapidjson-dev \
-        tzdata
+        tzdata \
+    && apt-get clean \
+    && rm -rf /var/lib/apt/lists/*
 
 # Ubuntu's gtest just provides sources, the compiled version is only available
 # from Ubuntu Cosmic on.
@@ -83,6 +85,4 @@ ENV CC=gcc \
      CMAKE_ARGS="-DThrift_SOURCE=BUNDLED -DFlatbuffers_SOURCE=BUNDLED 
-DGTest_SOURCE=BUNDLED -DgRPC_SOURCE=BUNDLED -Dc-ares_SOURCE=BUNDLED 
-DProtobuf_SOURCE=BUNDLED"
 
 # build and test
-CMD arrow/ci/docker_build_cpp.sh && \
-    cd /build/cpp && ctest -j2 --output-on-failure -L unittest
-
+CMD ["arrow/ci/docker_build_and_test_cpp.sh"]
diff --git a/cpp/Dockerfile.ubuntu-xenial b/cpp/Dockerfile.ubuntu-xenial
index 8384bdc..4302334 100644
--- a/cpp/Dockerfile.ubuntu-xenial
+++ b/cpp/Dockerfile.ubuntu-xenial
@@ -17,13 +17,13 @@
 
 FROM ubuntu:xenial
 
-# install build essentials
-RUN export DEBIAN_FRONTEND=noninteractive && \
-    apt-get update -y -q && \
-    apt-get install -y wget software-properties-common
-RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
-RUN apt-add-repository -y "deb http://apt.llvm.org/xenial/ 
llvm-toolchain-xenial-7 main"
-RUN export DEBIAN_FRONTEND=noninteractive && \
+SHELL ["/bin/bash", "-o", "pipefail", "-c"]
+
+ENV DEBIAN_FRONTEND noninteractive
+RUN apt-get update -y -q && \
+    apt-get install -y -q --no-install-recommends wget 
software-properties-common && \
+    wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
+    apt-add-repository -y "deb http://apt.llvm.org/xenial/ 
llvm-toolchain-xenial-7 main" && \
     apt-get update -y -q && \
     apt-get install -y -q --no-install-recommends \
         autoconf \
@@ -44,6 +44,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
         libgflags-dev \
         libgoogle-glog-dev \
         liblz4-dev \
+        libprotoc-dev \
         libprotobuf-dev \
         libre2-dev \
         libsnappy-dev \
@@ -54,7 +55,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
         ninja-build \
         pkg-config \
         protobuf-compiler \
-        tzdata
+        tzdata \
+    && apt-get clean \
+    && rm -rf /var/lib/apt/lists/*
 
 # Benchmark is deactivated as the external project requires CMake 3.6+
 # Flight is deactivated as Ubuntu provides gflags but not the CMake config for 
it.
@@ -74,5 +77,4 @@ ENV CC=gcc \
      CMAKE_ARGS="-DThrift_SOURCE=BUNDLED -DGTest_SOURCE=BUNDLED 
-DFlatbuffers_SOURCE=BUNDLED -DRapidJSON_SOURCE=BUNDLED"
 
 # build and test
-CMD arrow/ci/docker_build_cpp.sh && \
-    cd /build/cpp && ctest -j2 --output-on-failure -L unittest
+CMD ["arrow/ci/docker_build_and_test_cpp.sh"]
diff --git a/csharp/build/docker/Dockerfile b/csharp/build/docker/Dockerfile
index e6ad574..dca4a43 100644
--- a/csharp/build/docker/Dockerfile
+++ b/csharp/build/docker/Dockerfile
@@ -15,9 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-FROM microsoft/dotnet/2.1-sdk
+FROM mcr.microsoft.com/dotnet/core/sdk:2.1
 
-ADD csharp /arrow/csharp
+COPY csharp /arrow/csharp
 WORKDIR /arrow/csharp
 
-CMD dotnet build
\ No newline at end of file
+CMD ["dotnet", "build"]
diff --git a/docs/Dockerfile b/docs/Dockerfile
index d9441c2..8c2d00b 100644
--- a/docs/Dockerfile
+++ b/docs/Dockerfile
@@ -17,10 +17,8 @@
 
 FROM arrow:python-3.6
 
-ADD ci/conda_env_sphinx.yml /arrow/ci/
+COPY ci/conda_env_sphinx.yml /arrow/ci/
 RUN conda install --file arrow/ci/conda_env_sphinx.yml && \
     conda clean --all
 
-CMD arrow/ci/docker_build_cpp.sh && \
-    arrow/ci/docker_build_python.sh && \
-    arrow/ci/docker_build_sphinx.sh
+CMD ["/bin/bash", "-c", "arrow/ci/docker_build_cpp.sh && 
arrow/ci/docker_build_python.sh && arrow/ci/docker_build_sphinx.sh"]
diff --git a/go/Dockerfile b/go/Dockerfile
index 8261e1f..7e1d6ea 100644
--- a/go/Dockerfile
+++ b/go/Dockerfile
@@ -15,14 +15,13 @@
 # specific language governing permissions and limitations
 # under the License.
 
-FROM golang
+FROM golang:1.12
 
-ADD go/arrow/Gopkg.lock \
-    go/arrow/Gopkg.toml \
-    /arrow/go/arrow/
+COPY go/arrow/Gopkg.lock \
+     go/arrow/Gopkg.toml \
+     /arrow/go/arrow/
 WORKDIR /arrow/go/arrow
 
 RUN go get -d -t -v ./...
 
-CMD go install -v ./... && \
-    for d in $(go list ./... | grep -v vendor); do go test $d; done
+CMD ["/bin/bash", "-c", "go install -v ./... && for d in $(go list ./... | 
grep -v vendor); do go test $d; done"]
diff --git a/integration/dask/Dockerfile b/integration/dask/Dockerfile
index 5e054c5..ceadb3e 100644
--- a/integration/dask/Dockerfile
+++ b/integration/dask/Dockerfile
@@ -17,15 +17,11 @@
 
 FROM arrow:python-3.6
 
-# setup /etc/localtime
-RUN DEBIAN_FRONTEND=noninteractive \
-    apt-get install -y -q tzdata
-
 # install dask release from conda
 RUN conda install -c conda-forge dask pytest=3 && \
     conda clean --all
 
 # build and test
-CMD arrow/ci/docker_build_cpp.sh && \
+CMD ["/bin/bash", "-c", "arrow/ci/docker_build_cpp.sh && \
     arrow/ci/docker_build_python.sh && \
-    arrow/integration/dask/runtest.sh
+    arrow/integration/dask/runtest.sh"]
diff --git a/integration/hdfs/Dockerfile b/integration/hdfs/Dockerfile
index 7ad22f3..8744b79 100644
--- a/integration/hdfs/Dockerfile
+++ b/integration/hdfs/Dockerfile
@@ -24,12 +24,14 @@ ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 \
     HADOOP_OPTS=-Djava.library.path=/usr/local/hadoop/lib/native \
     PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
 RUN apt-get update -y && \
-    apt-get install -y openjdk-8-jdk && \
+    apt-get install -y --no-install-recommends openjdk-8-jdk && \
     wget -q -O hadoop-$HADOOP_VERSION.tar.gz 
"https://www.apache.org/dyn/mirrors/mirrors.cgi?action=download&filename=hadoop/common/hadoop-$HADOOP_VERSION/hadoop-$HADOOP_VERSION.tar.gz";
 && \
     tar -zxf /hadoop-$HADOOP_VERSION.tar.gz && \
     rm /hadoop-$HADOOP_VERSION.tar.gz && \
-    mv /hadoop-$HADOOP_VERSION /usr/local/hadoop
-ADD integration/hdfs/hdfs-site.xml $HADOOP_HOME/etc/hadoop/
+    mv /hadoop-$HADOOP_VERSION /usr/local/hadoop \
+    && apt-get clean \
+    && rm -rf /var/lib/apt/lists/*
+COPY integration/hdfs/hdfs-site.xml $HADOOP_HOME/etc/hadoop/
 
 # installing libhdfs3, it needs to be pinned, see ARROW-1465 and ARROW-1445
 # after the conda-forge migration it's failing with abi incompatibilities, so
@@ -46,6 +48,6 @@ ENV CC=gcc \
     ARROW_BUILD_TESTS=ON
 
 # build and test
-CMD arrow/ci/docker_build_cpp.sh && \
+CMD ["/bin/bash", "-c", "arrow/ci/docker_build_cpp.sh && \
     arrow/ci/docker_build_python.sh && \
-    arrow/integration/hdfs/runtest.sh
+    arrow/integration/hdfs/runtest.sh"]
diff --git a/integration/spark/Dockerfile b/integration/spark/Dockerfile
index 36b6479..d6a29bd 100644
--- a/integration/spark/Dockerfile
+++ b/integration/spark/Dockerfile
@@ -23,11 +23,13 @@ ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 \
     M2_HOME=/root/.m2 \
     PATH=/root/.m2/bin:/usr/local/maven/bin:$PATH
 RUN apt-get update -q -y && \
-    apt-get install -q -y openjdk-8-jdk && \
+    apt-get install -q -y --no-install-recommends openjdk-8-jdk && \
     wget -q -O maven-$MAVEN_VERSION.tar.gz 
"https://www.apache.org/dyn/mirrors/mirrors.cgi?action=download&filename=maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz";
 && \
     tar -zxf /maven-$MAVEN_VERSION.tar.gz && \
     rm /maven-$MAVEN_VERSION.tar.gz && \
-    mv /apache-maven-$MAVEN_VERSION /usr/local/maven
+    mv /apache-maven-$MAVEN_VERSION /usr/local/maven \
+    && apt-get clean \
+    && rm -rf /var/lib/apt/lists/*
 
 # installing specific version of spark
 ARG SPARK_VERSION=master
@@ -44,7 +46,7 @@ ENV CC=gcc \
     ARROW_BUILD_TESTS=OFF
 
 # build and test
-CMD arrow/ci/docker_build_cpp.sh && \
+CMD ["/bin/bash", "-c", "arrow/ci/docker_build_cpp.sh && \
     arrow/ci/docker_build_python.sh && \
     arrow/ci/docker_build_java.sh && \
-    arrow/integration/spark/runtest.sh
+    arrow/integration/spark/runtest.sh"]
diff --git a/java/Dockerfile b/java/Dockerfile
index d722e3d..9ee898f 100644
--- a/java/Dockerfile
+++ b/java/Dockerfile
@@ -19,8 +19,11 @@ FROM maven:3.5.2-jdk-8-slim
 
 # rsync is required to prevent the contamination of arrow directory
 # (mounted from the host)
-RUN apt-get update -y && apt-get install -y rsync
+RUN apt-get update -y \
+    && apt-get install -y --no-install-recommends rsync \
+    && apt-get clean \
+    && rm -rf /var/lib/apt/lists/*
 
-CMD arrow/ci/docker_build_java.sh && \
+CMD ["/bin/bash", "-c", "arrow/ci/docker_build_java.sh && \
     cd /build/java/arrow/java && \
-    mvn test
+    mvn test"]
diff --git a/js/Dockerfile b/js/Dockerfile
index 6f44917..311b4b9 100644
--- a/js/Dockerfile
+++ b/js/Dockerfile
@@ -15,18 +15,18 @@
 # specific language governing permissions and limitations
 # under the License.
 
-FROM node
+FROM node:11
 
 # install dependencies
-ADD js/.npmrc js/package.json /arrow/js/
+COPY js/.npmrc js/package.json /arrow/js/
 WORKDIR /arrow/js
 RUN npm install -g npm@latest && \
     npm install
 
 # build
-ADD LICENSE.txt /arrow/
-ADD NOTICE.txt /arrow/
-ADD js /arrow/js
+COPY LICENSE.txt /arrow/
+COPY NOTICE.txt /arrow/
+COPY js /arrow/js
 RUN npm run lint && npm run build
 
-CMD npm run test
+CMD ["npm", "run", "test"]
diff --git a/python/Dockerfile b/python/Dockerfile
index db83c0b..5fcadeb 100644
--- a/python/Dockerfile
+++ b/python/Dockerfile
@@ -19,7 +19,7 @@ FROM arrow:cpp
 
 # install python specific packages
 ARG PYTHON_VERSION=3.6
-ADD ci/conda_env_python.yml /arrow/ci/
+COPY ci/conda_env_python.yml /arrow/ci/
 RUN conda install -q \
         --file arrow/ci/conda_env_python.yml \
         python=$PYTHON_VERSION \
@@ -30,6 +30,4 @@ ENV ARROW_PYTHON=ON \
     ARROW_BUILD_TESTS=OFF
 
 # build and test
-CMD arrow/ci/docker_build_cpp.sh && \
-    arrow/ci/docker_build_python.sh && \
-    pytest -v --pyargs pyarrow
+CMD ["arrow/ci/docker_build_and_test_python.sh"]
diff --git a/python/Dockerfile.alpine b/python/Dockerfile.alpine
index 23c85cb..ed7b2d2 100644
--- a/python/Dockerfile.alpine
+++ b/python/Dockerfile.alpine
@@ -17,6 +17,8 @@
 
 FROM arrow:cpp-alpine
 
+SHELL ["/bin/bash", "-o", "pipefail", "-c"]
+
 # better compatibility for the scripts
 RUN apk add --no-cache coreutils
 
@@ -30,9 +32,9 @@ RUN export PYTHON_MAJOR=${PYTHON_VERSION:0:1} && \
     pip install --upgrade pip setuptools
 
 # install python requirements
-ADD python/requirements.txt \
-    python/requirements-test.txt \
-    /arrow/python/
+COPY python/requirements.txt \
+     python/requirements-test.txt \
+     /arrow/python/
 # pandas requires numpy at build time, so install the requirements separately
 RUN pip install -r /arrow/python/requirements.txt cython && \
     pip install -r /arrow/python/requirements-test.txt
@@ -42,6 +44,4 @@ ENV ARROW_PYTHON=ON \
     PYARROW_WITH_PARQUET=0
 
 # build and test
-CMD arrow/ci/docker_build_cpp.sh && \
-    arrow/ci/docker_build_python.sh && \
-    pytest -v --pyargs pyarrow
+CMD ["arrow/ci/docker_build_and_test_python.sh"]
diff --git a/r/Dockerfile b/r/Dockerfile
index 88cc21e..f70d395 100644
--- a/r/Dockerfile
+++ b/r/Dockerfile
@@ -72,5 +72,5 @@ ENV 
PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/build/cpp/src/arrow:/opt/conda/lib/pkgco
 ENV LD_LIBRARY_PATH=/opt/conda/lib/:/build/cpp/src/arrow:/arrow/r/src
 
 # build, install, test R package
-CMD /arrow/ci/docker_build_cpp.sh && \
-    /arrow/ci/docker_build_r.sh
+CMD ["/bin/bash", "-c", "/arrow/ci/docker_build_cpp.sh && \
+    /arrow/ci/docker_build_r.sh"]
diff --git a/rust/Dockerfile b/rust/Dockerfile
index 17661fc..77eba7b 100644
--- a/rust/Dockerfile
+++ b/rust/Dockerfile
@@ -20,7 +20,7 @@ FROM rustlang/rust:nightly
 # sadly cargo doesn't have a command to fetch and build the
 # dependencies without building the library itself
 ENV CARGO_TARGET_DIR=/build/rust
-ADD rust/Cargo.toml /arrow/rust/Cargo.toml
+COPY rust/Cargo.toml /arrow/rust/Cargo.toml
 WORKDIR /arrow/rust
 
-CMD cargo test
+CMD ["cargo", "test"]

Reply via email to