pjt222/agent-almanac/create-r-dockerfile
- community
Checking that the SKILL.md file is still in the repository.
Create a Dockerfile for R projects using rocker base images. Covers system dependency installation, R package installation, renv integration, and optimized layer ordering for fast rebuilds. Use when containerizing an R application or analysis, creating reproducible R environments, deploying R-based services (Shiny, Plumber, MCP server), or setting up consistent development environments across machines.
Install
npx vskill@latest install pjt222/agent-almanac/create-r-dockerfileSKILL.md
造 R Dockerfile
用 rocker 基像構 R 案 Dockerfile 含正依理。
用
- 容器化 R 應或析
- 建可重 R 境
- 部 R 基服(Shiny、Plumber、MCP server)
- 設一致發境
入
- 必:含依之 R 案(DESCRIPTION 或 renv.lock)
- 必:目(發、產、或服)
- 可:R 版(默:最新穩)
- 可:所需額系庫
行
一:擇基像
| 用 | 基像 | 寸 | |
|---|---|---|---|
| 最小 R 行 | rocker/r-ver:4.5.0 | ~800MB | |
| 含 tidyverse | rocker/tidyverse:4.5.0 | ~1.8GB | |
| 含 RStudio Server | rocker/rstudio:4.5.0 | ~1.9GB | |
| Shiny server | rocker/shiny-verse:4.5.0 | ~2GB |
得: 擇合案需而無冗之基像。
敗: 疑→始於 rocker/r-ver(最小)、需方加包。察 rocker-org 全像錄。
二:書 Dockerfile
得: Dockerfile 以 docker build -t myproject . 成構。
敗: apt-get install 中敗→察包名合目發行(Debian)。renv::restore() 敗→保 renv.lock 與 renv/activate.R 復前已複。
三:建 .dockerignore
得: .dockerignore 自 Docker 脈除 Git 史、IDE 檔、地 renv 庫、構品。
敗: Docker 構仍複餘檔→驗 .dockerignore 於 Dockerfile 同目、用正 glob 模。
四:構與試
得: 容器起含正 R 版與諸可用包。sessionInfo() 出確期 R 版。
敗: 察構誌之系依誤。加缺 -dev 包於 apt-get install。
五:優為產
產部用多段構:
得: 多段構生小終像。行段僅含編 R 包、非構具。
敗: 行段包載敗→保 COPY --from=builder 之庫路合 R 裝包處。兩段以 R -e ".libPaths()" 察。
驗
- [ ]
docker build無誤畢 - [ ] 容器起 R 段行
- [ ] 諸需包可用
- [ ]
.dockerignore除餘檔 - [ ] 像寸合用
- [ ] 僅碼變時重構速(層快行)
忌
- 缺系依:R 含編碼之包需
-dev庫。察install.packages()誤訊 - 層快失效:諸檔於裝包前複→碼每變必失快。先複鎖檔
- 大像:
apt-get install後rm -rf /var/lib/apt/lists/*。考多段構 - 時區問:加
ENV TZ=UTC或裝tzdata為時區覺操 - 行為 root:產加非 root 用:
RUN useradd -m appuser && USER appuser
例
參
setup-docker-compose- 調多容器containerize-mcp-server- MCP R 服專optimize-docker-build-cache- 進快策manage-renv-dependencies- renv.lock 入 Docker 構
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingi18n/wenyan-ultra/skills/create-r-dockerfile/SKILL.md
Popularity
- Repository stars
- 12
- Repository forks
- 1
- Repository npm downloads, 7 days
- 12
- 7-day trend score
- 23
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 30 Apr 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/pjt222/agent-almanac/create-r-dockerfile)