{"id":31581,"date":"2025-04-21T19:06:02","date_gmt":"2025-04-21T11:06:02","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/31581.html"},"modified":"2025-04-21T19:06:02","modified_gmt":"2025-04-21T11:06:02","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%ad%e4%bd%bf%e7%94%a8docker%e6%90%ad%e5%bb%barstudio%e5%88%86%e6%9e%90%e7%8e%af%e5%a2%83","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/31581.html","title":{"rendered":"\u5982\u4f55\u5728\u670d\u52a1\u5668\u4e2d\u4f7f\u7528docker\u642d\u5efaRstudio\u5206\u6790\u73af\u5883"},"content":{"rendered":"<h2>\u5982\u4f55\u5728\u670d\u52a1\u5668\u4e2d\u4f7f\u7528docker\u642d\u5efaRstudio\u5206\u6790\u73af\u5883<\/h2>\n<h3>\u9996\u5148\u786e\u4fdddocker\u5df2\u7ecf\u5b89\u88c5\u6210\u529f\u5e76\u4e14\u6210\u529f\u8fd0\u884c<\/h3>\n<p> <span class=\"token comment\"># docker\u547d\u4ee4\u5728root\u6743\u9650\u4e0b\u8fd0\u884c&#xff0c;\u672c\u6559\u7a0b\u4ee5centos 9\u4e3a\u4f8b<\/span><br \/>\n<span class=\"token comment\"># \u67e5\u770bdocker\u8be6\u7ec6\u4fe1\u606f<\/span><br \/>\n<span class=\"token function\">docker<\/span> info<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250421110600-6806269894519.png\" alt=\"image-20240905212426100\" \/><\/p>\n<p>\u6210\u529f\u5b89\u88c5\u5219\u4f1a\u663e\u793a\u5982\u56fe\u7684\u8be6\u7ec6docker\u4fe1\u606f<\/p>\n<p> <span class=\"token comment\"># \u67e5\u770bdocker\u662f\u5426\u8fd0\u884c<\/span><br \/>\nsystemctl status <span class=\"token function\">docker<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250421110600-68062698bedcc.png\" alt=\"image-20240905213033177\" \/><\/p>\n<h2>\u4e00\u3001\u4f7f\u7528dockerhub\u5df2\u6709\u955c\u50cf\u8fdb\u884c\u90e8\u7f72<\/h2>\n<h3>1\u3001docker\u62c9\u53d6\u955c\u50cf<\/h3>\n<p>\u5728docker\u4e2d\u67e5\u627e\u6240\u9700\u7684docker\u955c\u50cfrstudio&#xff1a;\u6b64\u5904\u4ee5 rocker\/rstudio:latest\u4e3a\u4f8b<\/p>\n<p><span class=\"token function\">docker<\/span> pull rocker\/rstudio:latest<\/p>\n<h3>2\u3001\u4f7f\u7528\u4e0b\u8f7d\u597d\u7684\u955c\u50cf\u521b\u5efa\u5bb9\u5668<\/h3>\n<p><span class=\"token function\">docker<\/span> run <span class=\"token parameter variable\">-itd<\/span> <span class=\"token parameter variable\">-p<\/span> <span class=\"token number\">8888<\/span>:8787 <span class=\"token parameter variable\">-d<\/span> <span class=\"token parameter variable\">&#8211;restart<\/span> always <span class=\"token parameter variable\">&#8211;name<\/span> <span class=\"token builtin class-name\">test<\/span> <span class=\"token parameter variable\">-v<\/span> \/home\/test\/rstudio\/:\/home\/test rocker\/rstudio:latest<br \/>\n<span class=\"token comment\"># \u6ce8&#xff1a;\u4f7f\u7528\u62c9\u53d6\u5230\u670d\u52a1\u5668\u4e2d\u7684\u955c\u50cf\u5728test\u7528\u6237rstudio\u6587\u4ef6\u5939\u4e0b\u6302\u8f7d<\/span><br \/>\n<span class=\"token comment\"># 1\u3001\u5c3d\u91cf\u4e0d\u8981\u4f7f\u75288787\u7aef\u53e3&#xff0c;\u6539\u7528\u5176\u4ed6\u7aef\u53e3&#xff0c;\u59828888\u662f\u6211\u81ea\u5df1\u8bbe\u7f6e\u7684\u6620\u5c04\u7aef\u53e3<\/span><br \/>\n<span class=\"token comment\"># 2\u3001-d &#8211;restart always\u8bbe\u7f6e\u81ea\u52a8\u542f\u52a8\u5bb9\u5668&#xff0c;\u5426\u5219\u670d\u52a1\u5668\u91cd\u542f\u6216docker\u670d\u52a1\u91cd\u542f\u4e4b\u540e&#xff0c;\u8be5\u5bb9\u5668\u8fd8\u5904\u4e8estop\u72b6\u6001<\/span><br \/>\n<span class=\"token comment\"># 3\u3001\u82e5\u5fd8\u8bb0\u8bbe\u7f6erestart always\u53ef\u4f7f\u7528&#xff1a;docker update &#8211;restart&#061;always test\u8fdb\u884c\u66f4\u65b0<\/span><\/p>\n<h3>3\u3001\u5728\u521b\u5efa\u597d\u7684\u5bb9\u5668\u4e2d\u521b\u5efa\u7528\u6237<\/h3>\n<p><span class=\"token comment\">#  \u8fdb\u5165test\u5bb9\u5668\u5185\u90e8<\/span><br \/>\n<span class=\"token function\">docker<\/span> <span class=\"token builtin class-name\">exec<\/span> <span class=\"token parameter variable\">-it<\/span> <span class=\"token builtin class-name\">test<\/span> <span class=\"token function\">bash<\/span><\/p>\n<p><span class=\"token comment\"># \u521b\u5efa\u7528\u6237&#xff1a;\u5373Rstudio-server\u767b\u5f55\u754c\u9762\u7684\u7528\u6237,\u6b64\u59041001\u4e3atest\u7528\u6237\u7684\u7528\u6237\u7ec4\u53f7&#xff0c;\u5177\u4f53\u6839\u636e\u81ea\u5df1\u7684\u5b50\u7528\u6237\u8fdb\u884c\u66f4\u6539<\/span><br \/>\nadduser <span class=\"token parameter variable\">-u<\/span>  <span class=\"token number\">1001<\/span> <span class=\"token builtin class-name\">test<\/span><br \/>\n<span class=\"token comment\"># \u8f93\u5165\u5bc6\u7801&#xff0c;\u91cd\u590d\u8f93\u5165\u4e24\u6b21\u5373\u53ef<\/span><\/p>\n<p><span class=\"token comment\"># \u66f4\u6539\u8be5\u5bb9\u5668\u4e2droot\u5bc6\u7801&#xff0c;\u8bbe\u7f6e\u5bc6\u7801\u5373\u53ef\u5728Rstudio\u7684\u7ec8\u7aef\u4e2d\u8fd0\u884csu\u547d\u4ee4\u8fdb\u5165root\u6743\u9650<\/span><br \/>\n<span class=\"token function\">passwd<\/span><\/p>\n<h3>4\u3001\u66f4\u6539\u7528\u6237rstudio\u6587\u4ef6\u5939\u6743\u9650<\/h3>\n<p><span class=\"token comment\"># \u7531\u4e8edocker\u521b\u5efa\u7684\u5bb9\u5668\u662f\u5728root\u6743\u9650\u4e0b\u8fdb\u884c\u7684&#xff0c;\u56e0\u6b64\u8be5\u6587\u4ef6\u5939\u6743\u9650\u5c5e\u4e8eroot&#xff0c;\u9700\u8981\u5c06\u5176\u6743\u9650\u6539\u4e3atest\u6240\u5c5e<\/span><br \/>\n<span class=\"token function\">chown<\/span> <span class=\"token parameter variable\">-R<\/span> test.test \/home\/test\/rstudio<\/p>\n<h3>5\u3001Rstudio-Server\u767b\u5f55<\/h3>\n<p><span class=\"token comment\"># \u67e5\u770b\u670d\u52a1\u5668ip<\/span><br \/>\n<span class=\"token function\">hostname<\/span> <span class=\"token parameter variable\">-i<\/span><br \/>\n<span class=\"token comment\">#\u4f7f\u7528\u670d\u52a1\u5668ip&#043;\u7aef\u53e3\u53f7\u5728\u6d4f\u89c8\u5668\u4e2d\u5373\u53ef\u767b\u5f55,\u8f93\u5165\u4e0a\u8ff0\u521b\u5efa\u7684\u8d26\u53f7\u5bc6\u7801<\/span><br \/>\nip:8888<\/p>\n<p>\u81f3\u6b64&#xff0c;\u7528\u6237test\u5373\u53ef\u4f7f\u7528Finalshell\u8f6f\u4ef6\u8fde\u63a5\u670d\u52a1\u5668\u5728rstudio\u6587\u4ef6\u5939\u4e0b\u8fdb\u884c\u6587\u4ef6\u4e0a\u4f20\u548c\u4e0b\u8f7d&#xff0c;\u9700\u6ce8\u610f&#xff1a;\u7531\u4e8elinux\u5b89\u88c5R\u5305\u6240\u9700\u7684\u4f9d\u8d56\u5bfc\u81f4R\u5305\u5b89\u88c5\u4e0d\u4e0a&#xff0c;\u5728Rstudio\u7684\u7ec8\u7aef\u4e2dsu\u8fdb\u5165root\u6839\u636e\u76f8\u5e94\u7684R\u5305\u4f9d\u8d56\u5e93\u8fdb\u884c\u5b89\u88c5&#xff0c;\u968f\u540e\u5728\u5b89\u88c5R\u5305\u5373\u53ef\u5b89\u88c5\u6210\u529f<\/p>\n<h2>\u4e8c\u3001\u81ea\u5b9a\u4e49Dockerfile\u8fdb\u884c\u90e8\u7f72\u2013\u63a8\u8350<\/h2>\n<h3>\u7531\u4e8e\u4e0d\u540c\u7528\u6237\u5bf9R\u5305\u7684\u9700\u6c42\u4e0d\u4e00&#xff0c;\u56e0\u6b64\u63a8\u8350\u4f7f\u7528Dockerfile\u81ea\u5b9a\u4e49\u5b89\u88c5\u6240\u9700\u7684R\u5305&#xff0c;\u90e8\u7f72\u597d\u7684Rstudio-server\u5c06\u81ea\u5e26\u8fd9\u4e9bR\u5305&#xff0c;\u4e0d\u518d\u9700\u8981\u624b\u52a8\u5b89\u88c5<\/h3>\n<p>\u6b64\u5904\u4ecd\u4ee5\u4e0a\u8ff0\u7684\u7a7a\u767dR\u5305\u7684Rstudio-server\u4e3a\u4f8b<\/p>\n<h3>1\u3001Dockerfile\u6587\u4ef6DIY<\/h3>\n<p><span class=\"token function\">vim<\/span>  Dockerfile<br \/>\n<span class=\"token comment\"># \u6839\u636eR\u5305\u7684\u9700\u8981\u8fdb\u884c\u81ea\u5b9a\u4e49Dockerfile\u6587\u4ef6&#xff0c;\u4ee5\u4e0b\u5185\u5bb9\u590d\u5236\u5230Dockerfile\u6587\u4ef6\u4e2d<\/span><br \/>\n<span class=\"token comment\"># \u7531\u4e8eR\u5305\u5f88\u591a&#xff0c;\u56e0\u6b64\u82b1\u8d39\u65f6\u95f4\u8f83\u957f\u7ea63\u5c0f\u65f6&#xff0c;\u4e0d\u540c\u7528\u6237\u53ef\u4ee5\u81ea\u5b9a\u4e49\u6240\u9700\u7684R\u5305<\/span><\/p>\n<p>FROM rocker\/rstudio:latest <\/p>\n<p>ARG <span class=\"token assign-left variable\">bioc_ver<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">3.19<\/span><\/p>\n<p>RUN <span class=\"token function\">apt-get<\/span> clean all <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n    <span class=\"token function\">apt-get<\/span> update <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n    <span class=\"token function\">apt-get<\/span> upgrade <span class=\"token parameter variable\">-y<\/span> <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n    <span class=\"token function\">apt-get<\/span> <span class=\"token function\">install<\/span> <span class=\"token parameter variable\">-y<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libhdf5-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libssl-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libxml2-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libpng-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libxt-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        zlib1g-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libbz2-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        liblzma-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libglpk40 <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libgit2-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libbz2-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libfontconfig1-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libharfbuzz-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libhdf5-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        patch <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libharfbuzz-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libfribidi-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libfreetype6-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libpng-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libtiff5-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libjpeg-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        jags <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libgmp3-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libmpfr-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libv8-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libcairo2-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libmagick&#043;&#043;-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        cmake <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libgdal-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libssl-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libssh2-1-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n        libxml2-dev <span class=\"token punctuation\">\\\\<\/span><br \/>\n    <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token function\">apt-get<\/span> clean all <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n    <span class=\"token function\">apt-get<\/span> purge <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n    <span class=\"token function\">rm<\/span> <span class=\"token parameter variable\">-rf<\/span> \/var\/lib\/apt\/lists\/* \/tmp\/* \/var\/tmp\/*<\/p>\n<p>RUN Rscript <span class=\"token parameter variable\">-e<\/span> <span class=\"token string\">&#034;install.packages(c(&#039;rmarkdown&#039;, &#039;tidyverse&#039;, &#039;workflowr&#039;, &#039;BiocManager&#039;, &#039;pacman&#039;, &#039;devtools&#039;, &#039;hdf5r&#039;, &#039;ggiraphExtra&#039;, &#039;magick&#039;,&#039;alphahull&#039;, &#039;dbscan&#039;), ask &#061; F, update &#061; F, dependencies &#061; T);&#034;<\/span><br \/>\nRUN Rscript <span class=\"token parameter variable\">-e<\/span> <span class=\"token string\">&#034;BiocManager::install(version &#061; &#039;<span class=\"token variable\">${bioc_ver}<\/span>&#039;)&#034;<\/span><br \/>\nRUN Rscript <span class=\"token parameter variable\">-e<\/span> <span class=\"token string\">&#034;library(pacman);pacman::p_load(ggplot2, dplyr, data.table, magrittr, patchwork, RColorBrewer, clustree, cowplot,harmony, ggrepel, GSVA, clusterProfiler, survminer, ggpubr, stringr, rio, pheatmap, survival,sctransform, tibble,futile.logger, ggrisk, ggstatsplot, timeROC, maftools, edgeR, DESeq2, FactoMineR, factoextra, org.Hs.eg.db, stringi,cowplot, ggsci, VennDiagram, ggplotify, GEOquery, TCGAbiolinks, SummarizedExperiment, scCustomize, xml2, rvest, raster, rmarkdown, rticles, openai, update &#061; F)&#034;<\/span><br \/>\nRUN Rscript <span class=\"token parameter variable\">-e<\/span> <span class=\"token string\">&#034;BiocManager::install(c(\u2018seurat\u2019&#xff0c;&#039;GSEABase&#039;, &#039;GEOquery&#039;, &#039;limma&#039;, &#039;impute&#039;, &#039;hgu133plus2.db&#039;, &#039;infercnv&#039;, &#039;SingleR&#039;, &#039;tidydr&#039;,&#039;simplifyEnrichment&#039;, &#039;biomaRt&#039;, &#039;EnsDb.Hsapiens.v86&#039;, &#039;Rhtslib&#039;, &#039;Rsamtools&#039;, &#039;GenomicAlignments&#039;,&#039;rtracklayer&#039;, &#039;GenomicFeatures&#039;, &#039;ensembldb&#039;, &#039;paletteer&#039;, &#039;ggdendro&#039;, &#039;monocle&#039;, &#039;BiocGenerics&#039;, &#039;DelayedArray&#039;, &#039;DelayedMatrixStats&#039;,&#039;S4Vectors&#039;,&#039;SingleCellExperiment&#039;,&#039;batchelor&#039;, &#039;kstreet13\/slingshot&#039;), ask &#061; F, update &#061; F, dependencies &#061; T)&#034;<\/span><\/p>\n<h3>2\u3001\u521b\u5efadocker\u955c\u50cf<\/h3>\n<p><span class=\"token function\">docker<\/span> build <span class=\"token parameter variable\">-t<\/span> test_image\/rstudio:r.4.4.1 <span class=\"token builtin class-name\">.<\/span><br \/>\n<span class=\"token comment\">#.\u8868\u793aDockerfile\u5728\u5f53\u524d\u76ee\u5f55\u4e0b<\/span><\/p>\n<h3>3\u3001\u4f7f\u7528\u81ea\u5b9a\u4e49\u7684docker\u955c\u50cf\u521b\u5efa\u5bb9\u5668<\/h3>\n<p><span class=\"token function\">docker<\/span> run <span class=\"token parameter variable\">-itd<\/span> <span class=\"token parameter variable\">-p<\/span> <span class=\"token number\">8888<\/span>:8787 <span class=\"token parameter variable\">-d<\/span> <span class=\"token parameter variable\">&#8211;restart<\/span> always <span class=\"token parameter variable\">&#8211;name<\/span> <span class=\"token builtin class-name\">test<\/span> <span class=\"token parameter variable\">-v<\/span> \/home\/test\/rstudio\/:\/home\/test test_image\/rstudio:r.4.4.1<br \/>\n<span class=\"token comment\"># \u540e\u7eed\u64cd\u4f5c\u540c\u524d\u6587\u4e00\u6837&#xff0c;\u521b\u5efa\u7528\u6237&#xff0c;\u66f4\u6539rstudio\u6587\u4ef6\u5939\u6743\u9650<\/span><\/p>\n<h3>4\u3001\u5728\u521b\u5efa\u597d\u7684\u5bb9\u5668\u4e2d\u521b\u5efa\u7528\u6237<\/h3>\n<p><span class=\"token comment\">#  \u8fdb\u5165test\u5bb9\u5668\u5185\u90e8<\/span><br \/>\n<span class=\"token function\">docker<\/span> <span class=\"token builtin class-name\">exec<\/span> <span class=\"token parameter variable\">-it<\/span> <span class=\"token builtin class-name\">test<\/span> <span class=\"token function\">bash<\/span><\/p>\n<p><span class=\"token comment\"># \u521b\u5efa\u7528\u6237&#xff1a;\u5373Rstudio-server\u767b\u5f55\u754c\u9762\u7684\u7528\u6237,\u6b64\u59041001\u4e3atest\u7528\u6237\u7684\u7528\u6237\u7ec4\u53f7&#xff0c;\u5177\u4f53\u6839\u636e\u81ea\u5df1\u7684\u5b50\u7528\u6237\u8fdb\u884c\u66f4\u6539<\/span><br \/>\nadduser <span class=\"token parameter variable\">-u<\/span>  <span class=\"token number\">1001<\/span> <span class=\"token builtin class-name\">test<\/span><br \/>\n<span class=\"token comment\"># \u8f93\u5165\u5bc6\u7801&#xff0c;\u91cd\u590d\u8f93\u5165\u4e24\u6b21\u5373\u53ef<\/span><\/p>\n<p><span class=\"token comment\"># \u66f4\u6539\u8be5\u5bb9\u5668\u4e2droot\u5bc6\u7801&#xff0c;\u8bbe\u7f6e\u5bc6\u7801\u5373\u53ef\u5728Rstudio\u7684\u7ec8\u7aef\u4e2d\u8fd0\u884csu\u547d\u4ee4\u8fdb\u5165root\u6743\u9650<\/span><br \/>\n<span class=\"token function\">passwd<\/span><\/p>\n<h3>5\u3001\u66f4\u6539\u7528\u6237rstudio\u6587\u4ef6\u5939\u6743\u9650<\/h3>\n<p><span class=\"token comment\"># \u7531\u4e8edocker\u521b\u5efa\u7684\u5bb9\u5668\u662f\u5728root\u6743\u9650\u4e0b\u8fdb\u884c\u7684&#xff0c;\u56e0\u6b64\u8be5\u6587\u4ef6\u5939\u6743\u9650\u5c5e\u4e8eroot&#xff0c;\u9700\u8981\u5c06\u5176\u6743\u9650\u6539\u4e3atest\u6240\u5c5e<\/span><br \/>\n<span class=\"token function\">chown<\/span> <span class=\"token parameter variable\">-R<\/span> test.test \/home\/test\/rstudio<\/p>\n<h3>6\u3001Rstudio-Server\u767b\u5f55<\/h3>\n<p><span class=\"token comment\"># \u67e5\u770b\u670d\u52a1\u5668ip<\/span><br \/>\n<span class=\"token function\">hostname<\/span> <span class=\"token parameter variable\">-i<\/span><br \/>\n<span class=\"token comment\">#\u4f7f\u7528\u670d\u52a1\u5668ip&#043;\u7aef\u53e3\u53f7\u5728\u6d4f\u89c8\u5668\u4e2d\u5373\u53ef\u767b\u5f55,\u8f93\u5165\u4e0a\u8ff0\u521b\u5efa\u7684\u8d26\u53f7\u5bc6\u7801<\/span><br \/>\nip:8888<\/p>\n<h2>\u4e09\u3001\u5c06\u81ea\u5df1\u7684Dockerfile\u955c\u50cf\u6253\u5305\u8fc1\u79fb\u81f3\u65b0\u7684\u670d\u52a1\u5668\u8fdb\u884c\u90e8\u7f72<\/h2>\n<h3>1\u3001\u5728\u539f\u670d\u52a1\u5668\u4e0a\u6253\u5305\u5df2\u6709\u955c\u50cf<\/h3>\n<p><span class=\"token comment\"># \u4ee5\u4e0a\u8ff0\u7684Dockfile\u521b\u5efa\u7684\u955c\u50cf\u4e3a\u4f8b<\/span><br \/>\n<span class=\"token function\">docker<\/span> save <span class=\"token parameter variable\">-o<\/span> test_image.tar test_image\/rstudio:r.4.4.1<br \/>\n<span class=\"token comment\"># \u4f7f\u7528finalshell\u5c06\u5176\u4e0b\u8f7d\u5230\u672c\u5730&#xff0c;\u5e76\u4e0a\u4f20\u5230\u65b0\u670d\u52a1\u5668\u4e2d<\/span><\/p>\n<h3>2\u3001\u5728\u65b0\u670d\u52a1\u5668\u4e0a\u90e8\u7f72\u955c\u50cf<\/h3>\n<p><span class=\"token function\">docker<\/span> load <span class=\"token parameter variable\">-i<\/span> test_image.tar<br \/>\n<span class=\"token comment\"># \u4f7f\u7528docker images\u67e5\u770b\u955c\u50cf&#xff0c;\u5373\u5728\u65b0\u670d\u52a1\u5668\u4e2d\u5b58\u5728test_image\/rstudio:r.4.4.1\u955c\u50cf<\/span><\/p>\n<p>\u540e\u7eed\u521b\u5efa\u5bb9\u5668\u548c\u6dfb\u52a0\u7528\u6237\u6d41\u7a0b\u548c\u4e0a\u8ff0\u4e00\u81f4<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.4k\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf14\u6b21\u3002\u5982\u4f55\u5728\u670d\u52a1\u5668\u4e2d\u4f7f\u7528docker\u642d\u5efaRstudio\u5206\u6790\u73af\u5883_docker rstudio<\/p>\n","protected":false},"author":2,"featured_media":31579,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[27,58,799],"topic":[],"class_list":["post-31581","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-docker","tag-linux","tag-r"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5982\u4f55\u5728\u670d\u52a1\u5668\u4e2d\u4f7f\u7528docker\u642d\u5efaRstudio\u5206\u6790\u73af\u5883 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/31581.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5982\u4f55\u5728\u670d\u52a1\u5668\u4e2d\u4f7f\u7528docker\u642d\u5efaRstudio\u5206\u6790\u73af\u5883 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.4k\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf14\u6b21\u3002\u5982\u4f55\u5728\u670d\u52a1\u5668\u4e2d\u4f7f\u7528docker\u642d\u5efaRstudio\u5206\u6790\u73af\u5883_docker rstudio\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/31581.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-21T11:06:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250421110600-6806269894519.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/31581.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/31581.html\",\"name\":\"\u5982\u4f55\u5728\u670d\u52a1\u5668\u4e2d\u4f7f\u7528docker\u642d\u5efaRstudio\u5206\u6790\u73af\u5883 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-21T11:06:02+00:00\",\"dateModified\":\"2025-04-21T11:06:02+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/31581.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/31581.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/31581.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5982\u4f55\u5728\u670d\u52a1\u5668\u4e2d\u4f7f\u7528docker\u642d\u5efaRstudio\u5206\u6790\u73af\u5883\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5982\u4f55\u5728\u670d\u52a1\u5668\u4e2d\u4f7f\u7528docker\u642d\u5efaRstudio\u5206\u6790\u73af\u5883 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/31581.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5982\u4f55\u5728\u670d\u52a1\u5668\u4e2d\u4f7f\u7528docker\u642d\u5efaRstudio\u5206\u6790\u73af\u5883 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.4k\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf14\u6b21\u3002\u5982\u4f55\u5728\u670d\u52a1\u5668\u4e2d\u4f7f\u7528docker\u642d\u5efaRstudio\u5206\u6790\u73af\u5883_docker rstudio","og_url":"https:\/\/www.wsisp.com\/helps\/31581.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-21T11:06:02+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250421110600-6806269894519.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/31581.html","url":"https:\/\/www.wsisp.com\/helps\/31581.html","name":"\u5982\u4f55\u5728\u670d\u52a1\u5668\u4e2d\u4f7f\u7528docker\u642d\u5efaRstudio\u5206\u6790\u73af\u5883 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-21T11:06:02+00:00","dateModified":"2025-04-21T11:06:02+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/31581.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/31581.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/31581.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5982\u4f55\u5728\u670d\u52a1\u5668\u4e2d\u4f7f\u7528docker\u642d\u5efaRstudio\u5206\u6790\u73af\u5883"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/31581","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=31581"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/31581\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/31579"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=31581"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=31581"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=31581"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=31581"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}