Created
September 18, 2019 00:06
-
-
Save alexhallam/f8b3632d1053c739e734f96105c3af44 to your computer and use it in GitHub Desktop.
Rocker Docker includes odbc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM rocker/verse:3.6.0 | |
# install some packages needed for odbc and MS repo | |
RUN apt-get update && apt-get install -y \ | |
curl \ | |
apt-utils \ | |
apt-transport-https \ | |
debconf-utils \ | |
build-essential \ | |
&& rm -rf /var/lib/apt/lists/* | |
# adding custom MS repository | |
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - | |
RUN curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list | |
# install SQL Server drivers | |
# install SQL Server tools | |
RUN apt-get update && ACCEPT_EULA=Y apt-get -y install msodbcsql17 mssql-tools | |
RUN echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc | |
RUN /bin/bash -c "source ~/.bashrc" | |
# install r packages | |
RUN install2.r --error \ | |
httr \ | |
recipes \ | |
rsample \ | |
parsnip \ | |
feather \ | |
data.table \ | |
janitor \ | |
forecast \ | |
prophet \ | |
# Rcpp \ # should be included with tidyverse | |
fs \ | |
rsample \ | |
skimr \ | |
log4r \ | |
vroom \ | |
corrr \ | |
odbc \ | |
tsibble \ | |
DBI |
-e --error throw error and halt instead of a warning [default: FALSE]
Only to register here for future searchers: if you want to use rocker/verse:4.1.2
(latest available ATM) use the following code and don't forget to use Driver = ODBC Driver 17 for SQL Server
for the odbc
connection string.
FROM rocker/verse:4.1.2
# install some packages needed for odbc and MS repo
RUN apt-get update && apt-get install -y \
curl \
apt-utils \
apt-transport-https \
debconf-utils \
build-essential \
unixodbc \
&& rm -rf /var/lib/apt/lists/*
# adding custom MS repository
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list
# install SQL Server drivers
# install SQL Server tools
RUN apt-get update && ACCEPT_EULA=Y apt-get -y install msodbcsql17 mssql-tools
RUN echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
RUN /bin/bash -c "source ~/.bashrc"
Thanks
@ggpinto thanks for the update
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello- thanks for posting this dockerfile. Could you explain to me the purpose of
--error
on line 22?