Skip to content

Commit

Permalink
docker build working
Browse files Browse the repository at this point in the history
  • Loading branch information
seabbs committed Jul 1, 2021
1 parent ae46da4 commit 49deed2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
19 changes: 10 additions & 9 deletions .devcontainer/Dockerfile
Expand Up @@ -11,9 +11,9 @@ ARG UPGRADE_PACKAGES="false"

# Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies.
ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_UID=1100
ARG USER_GID=$USER_UID
COPY library-scripts/*.sh /tmp/library-scripts/
COPY .devcontainer/library-scripts/*.sh /tmp/library-scripts/
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" "true" "true" \
&& usermod -a -G staff ${USERNAME} \
Expand All @@ -24,11 +24,14 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
libssl-dev \
libxml2-dev \
libxt-dev \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts \
&& python3 -m pip --no-cache-dir install radian \
&& install2.r --error --skipinstalled --repos ${CRAN} --ncpus -1 \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts

RUN python3 -m pip --no-cache-dir install radian pre-commit
RUN install2.r --error --skipinstalled --repos ${CRAN} --ncpus -1 \
devtools \
languageserver \
precommit \
git2r \
&& rm -rf /tmp/downloaded_packages

# [Optional] Uncomment this section to install additional OS packages.
Expand All @@ -37,10 +40,8 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

# install dependencies
RUN Rscript -e "devtools::install_dev_deps()"

# configure precommit
RUN Rscript -e "precommit::install_precommit(); precommit::use_precommit()"
COPY DESCRIPTION /tmp/package/DESCRIPTION
RUN Rscript -e "devtools::install_dev_deps('/tmp/package')"

# add docthis
RUN Rscript -e 'devtools::install_github("mdlincoln/docthis")'
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Expand Up @@ -5,7 +5,8 @@
"build": {
"dockerfile": "Dockerfile",
// Update VARIANT to pick a specific R version: latest, ... ,4.0.1 , 4.0.0
"args": { "VARIANT": "latest" }
"args": { "VARIANT": "latest" },
"context": ".."
},

// Set *default* container specific settings.json values on container create.
Expand Down

0 comments on commit 49deed2

Please sign in to comment.