From da54a305db4cbd0cb8e2de002ff02dc6a24d51b9 Mon Sep 17 00:00:00 2001 From: aaa Date: Fri, 15 Nov 2024 09:55:48 +0000 Subject: [PATCH] Change to better image --- devcontainer.json | 31 ++++++++++++------------------- postCreateCommand.sh | 12 +++++------- 2 files changed, 17 insertions(+), 26 deletions(-) diff --git a/devcontainer.json b/devcontainer.json index 7b56482..da8ccd6 100644 --- a/devcontainer.json +++ b/devcontainer.json @@ -1,32 +1,25 @@ { "name": "Data Science (Python and R)", - "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "image": "quay.io/jupyter/r-notebook:latest", // Features to add to the dev container. More info: https://containers.dev/features. "features": { - "ghcr.io/devcontainers/features/python:1": { - "version": "latest" - }, - "ghcr.io/rocker-org/devcontainer-features/r-apt:latest": { + "ghcr.io/h4rvey-g/rocker-devcontainer-features/r-apt:latest": { "vscodeRSupport": "full", - "installDevTools": true, "installRadian": true, - "installRMarkdown": true, - "installVscDebugger": true, - "installJupyterlab": true - }, - "ghcr.io/h4rvey-g/rocker-devcontainer-features/apt-packages:1": { - "packages": "r-cran-data.table,r-cran-tidyverse", - "upgradePackages": true - }, - // "ghcr.io/rocker-org/devcontainer-features/miniforge:1": {}, + "installVscDebugger": true + } + // "ghcr.io/h4rvey-g/rocker-devcontainer-features/apt-packages:1": { + // "packages": "r-cran-data.table,r-cran-tidyverse", + // "upgradePackages": true + // }, // "ghcr.io/rocker-org/devcontainer-features/r-packages:1": { // "packages": "rliger,Seurat,qs,targets" // } }, "shutdownAction": "none", - "overrideFeatureInstallOrder": [ - "ghcr.io/rocker-org/devcontainer-features/r-apt" - ], + // "overrideFeatureInstallOrder": [ + // "ghcr.io/rocker-org/devcontainer-features/r-apt" + // ], // Use 'postCreateCommand' to run commands after the container is created. "postCreateCommand": "/bin/bash ./.devcontainer/postCreateCommand.sh", // Use 'forwardPorts' to make a list of ports inside the container available locally. @@ -68,5 +61,5 @@ } }, // Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "vscode" + "remoteUser": "jovyan" } diff --git a/postCreateCommand.sh b/postCreateCommand.sh index 2689ba5..e8aa4e2 100644 --- a/postCreateCommand.sh +++ b/postCreateCommand.sh @@ -1,10 +1,8 @@ -pip install ipykernel ipywidgets - -if [ -f requirements.txt* ]; then - pip install -r requirements.txt -else pip install pandas numpy matplotlib seaborn scikit-learn; fi +# if [ -f requirements.txt* ]; then +# pip install -r requirements.txt +# else pip install pandas numpy matplotlib seaborn scikit-learn; fi # fix permission issue -sudo chmod 777 /usr/local/lib/R/site-library/_cache/ +# sudo chmod 777 /usr/local/lib/R/site-library/_cache/ # enable vscode R support echo 'if (interactive() && Sys.getenv("RSTUDIO") == "") { source(file.path(Sys.getenv(if (.Platform$OS.type == "windows") "USERPROFILE" else "HOME"), ".vscode-R", "init.R")) @@ -24,4 +22,4 @@ touch ~/.lintr echo 'linters: linters_with_defaults( line_length_linter(120), commented_code_linter = NULL - )' >>~/.lintr \ No newline at end of file + )' >>~/.lintr