Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARROW-3366: [R] Dockerfile for docker-compose setup #2770

Closed
wants to merge 13 commits into from
Next Next commit
ARROW-3366: [R] Dockerfile for docker-compose setup
  • Loading branch information
jameslamb committed Nov 17, 2018
commit 210a7745f832eb8626168321b455752fd754e932
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ services:
dockerfile: rust/Dockerfile
volumes: *volumes

r:
# Usage:
# docker-compose build r
kszucs marked this conversation as resolved.
Show resolved Hide resolved
# docker-compose run r
image: arrow:r
build:
context: .
dockerfile: r/Dockerfile
volumes: *volumes

######################### Tools and Linters #################################

# TODO(kszucs): site
Expand Down
2 changes: 1 addition & 1 deletion r/.Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ src/.clang-format
LICENSE.md
^data-raw$
lint.sh

Dockerfile
64 changes: 64 additions & 0 deletions r/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# 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
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

FROM arrow:cpp

# get the stuff
ADD r /arrow/r
kszucs marked this conversation as resolved.
Show resolved Hide resolved

# Configure
ENV CC=gcc \
CXX=g++

# r-base includes tzdata. Get around interactive stop in that package
ENV DEBIAN_FRONTEND=noninteractive

# Build R
# [1] https://www.digitalocean.com/community/tutorials/how-to-install-r-on-ubuntu-18-04
# [2] https://linuxize.com/post/how-to-install-r-on-ubuntu-18-04/#installing-r-packages-from-cran
RUN apt install -y \
kszucs marked this conversation as resolved.
Show resolved Hide resolved
apt-transport-https \
software-properties-common && \
apt-key adv \
--keyserver keyserver.ubuntu.com \
--recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 && \
add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/' && \
apt install -y r-base && \
# system libs needed by core R packages
apt install -y \
libgit2-dev \
libssl-dev && \
# Install vctrs from CRAN
Rscript -e "install.packages('devtools', repos = 'http://cran.rstudio.com')" && \
Rscript -e "devtools::install_github('r-lib/vctrs')" && \
# R is not good at picking up dependencies and installing them automatically
Rscript -e "install.packages(c( \
'Rcpp', \
'purrr', \
'assertthat', \
'fs', \
'tibble', \
'crayon', \
'testthat'), \
repos = 'http://cran.rstudio.com')"

# build, install, test R package
CMD arrow/ci/docker_build_cpp.sh && \
cd /arrow/r && \
R CMD build . && \
R CMD INSTALL $(ls | grep arrow_*.tar.gz) && \
R CMD check $(ls | grep arrow_*.tar.gz) --as-cran
kszucs marked this conversation as resolved.
Show resolved Hide resolved