美文网首页
VScode+Docker学习

VScode+Docker学习

作者: 哇珍 | 来源:发表于2021-08-16 10:34 被阅读0次

参考:Analysis of single cell RNA-seq data
【高清】2020黑马程序员 Docker讲解_哔哩哔哩_bilibili
Using the RStudio image · rocker-org/rocker Wiki · GitHub
Docker 从入门到实践 (docker-practice.com)
docker命令大全
Docker 镜像、容器 常用命令,容器与宿主服务器文件复制
docker docs

docker部署rocker/rstudio

docker run --rm \
           -p 9290:8787 \
           -d \
           --name wangzh \
           -v /home/zhanglab_wangzh:/home \
           -e USER=wangzh \
           -e ROOT=TRUE \
           -e PASSWORD=123456 \
           rocker/rstudio:latest

9290是我自己的端口,8787是rocker/rstudio的端口;命名容器为wangzh;将/home/zhanglab_wangzh的内容复制到容器的/home;登录名为wangzh;
ROOT=TRUE表示从 RStudio 中启用 root,用户在未先进入容器的情况下使用 apt-get 安装二进制库。

Clean up (--rm)

By default a container’s file system persists even after the container exits. This makes debugging a lot easier (since you can inspect the final state) and you retain all your data by default. But if you are running short-term foreground processes, these container file systems can really pile up. If instead you’d like Docker to automatically clean up the container and remove the file system when the container exits, you can add the --rm flag:

--rm=false: Automatically remove the container when it exits

Note

If you set the --rm flag, Docker also removes the anonymous volumes associated with the container when the container is removed. This is similar to running docker rm -v my-container. Only volumes that are specified without a name are removed. For example, when running:

docker run --rm -v /foo -v awesome:/bar busybox top

the volume for /foo will be removed, but the volume for /bar will not. Volumes inherited via --volumes-from will be removed with the same logic: if the original volume was specified with a name it will not be removed.

进入容器

docker exec -it wangzh /bin/bash

文件传输(不推荐!!!!不到万不得已不要用啊!!!)

将之前的服务器上的数据拷贝到rocker/rstudio镜像上:

docker cp 本地文件路径 ID全称:容器路径(这东西会导致用户改变!!!简直是个大坑!!!直接将我的用户组从zhanglab_wangzh改为了dell)

docker cp /home/zhanglab_wangzh 109984638e04:/home/wangzh/

同理,如果是容器传输文件到本地的话,反过来就好了:

docker cp ID全称:容器文件路径 本地路径

安装 R 系统外部依赖
许多 R 包有外部依赖,如 GSL, GDAL, JAGS,为了安装它们,你需要进行如下的操作:
具体的参考:https://jsta.github.io/r-docker-tutorial/03-install-packages.html

docker ps # find the ID of the running container you want to add a package to
docker exec -it <container-id> bash # a docker command to start a bash shell in your container
apt-get install libgsl0-dev # install the package, in this case GSL

如果安装报错,先试试 apt-get update

Dockerfile安装R包

Update to R 4.1.0 · davetang/learning_docker@425cff3 · GitHub

到容器的指定地址:

https://www.youtube.com/watch?v=lfG8cTqRRNA
https://github.com/SymbolixAU/r_docker_hello
https://github.com/SymbolixAU/useR_docker_tutorial

相关文章

  • VScode+Docker学习

    参考:Analysis of single cell RNA-seq data[https://scrnaseq-...

  • 使用VSCode+Docker搭建PHP远程开发环境

    为什么 搭建VSCode+Docker搭建PHP远程开发环境搭建,主要解决以下几个问题: 微信开发调试问题。 随时...

  • VSCode+Docker构建Python开发环境

    1 优缺点 1.1 优点 写代码和调试更方便 带语法提示且反应快 支持直接在命令行敲命令运行 一个工具同时开发调试...

  • 学习学习学习

    第三天了,连续三天,早上睁眼开始,看视频,做课件,连续作业,直到晚上十二点才睡觉。吃饭不规律,想起来就吃,感觉不饿...

  • 学习学习学习

    23岁的我,才真正明白,什么是学习,什么是努力,努力和不努力真的不同,就好比同样是一篇稿子,我用一周背下来,有的人...

  • 学习学习学习!

    妈妈总是让我学习,我只能用装当办法。 方法一: 方法二: 方法三: 方法四: ...

  • 学习学习学习

    001.今天看财富自由之路看了第二遍,而且看了一半,算是完成任务很开心。中间有想放弃的念头,坚持看完。眼睛痛,一直...

  • 学习学习学习

    马自达为什么坚持高压缩比自吸

  • 学习!学习!学习!

    学习的痛苦是暂时的 没有学到的痛苦是永恒的 因为学习而特别充实的一天 很踏实 ~~~~ 2015.11.28.阴天...

  • 学习!学习!学习!

    无数次想要去逃离,可这封闭的世界根本出不去。你没有什么可以抛弃、只能咬着牙带着面具微笑的活下去。 没有那个人、他也...

网友评论

      本文标题:VScode+Docker学习

      本文链接:https://www.haomeiwen.com/subject/kahgmltx.html