-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
29 lines (21 loc) · 867 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM rocker/r-ver:4.1.2
MAINTAINER Joao Santiago <[email protected]>
RUN apt-get update && apt-get install -y --no-install-recommends \
#needed for git2r
libssl-dev \
zlib1g-dev \
# needed for curl
libcurl4-openssl-dev && \
apt-get clean -y && rm -rf /var/lib/apt/lists/*
RUN install2.r -e remotes xgboost plumber
COPY . /tmp/pkg
RUN R CMD build /tmp/pkg
# install the package
RUN mv *.tar.gz sagemakermultimodel.tar.gz
RUN R -e 'install.packages("sagemakermultimodel.tar.gz", repos = NULL, type = "source")' &&\
rm -rf /tmp/pkg
# needed when using the container as part of a Sagemaker pipeline
LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true
LABEL com.amazonaws.sagemaker.capabilities.multi-models=true
COPY start_api.R /opt/ml/start_api.R
ENTRYPOINT ["Rscript", "/opt/ml/start_api.R", "--no-save"]