【Docker】常用命令记录

2020-06-11  本文已影响0人  Geekero

查看已有的docker镜像

$docker images
REPOSITORY                       TAG                 IMAGE ID            CREATED             SIZE
aertslab/pyscenic                latest              04c50b0d9344        3 weeks ago         986MB
desc_rstudio                     latest              08e3683cab26        6 weeks ago         12.8GB
cellassign_rstudio_debian        latest              17077ba23c0d        8 weeks ago         6.71GB

创建Docker容器

$docker run -it -v /share/nas1/Data/Users/luohb/Pipline/BD:/home/luohb/BD -p 8887:8888 desc_rstudio /bin/bash

删除Docker

$docker ps -a #查看镜像和容器情况
CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS                     PORTS               NAMES
61456c731cd4        bdgenomics/rhapsody   "/usr/bin/tini -- /b…"   58 seconds ago      Exited (0) 4 seconds ago                       heuristic_dirac
095cf158a83e        c5d48e81b986          "/bin/bash"              8 days ago          Up 29 hours                                    test_sge_sjm

$docker rm 61456c731cd4 
61456c731cd4

重新进入Docker

$docker ps -a
CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS                      PORTS               NAMES
9e098a2c1b11        bdgenomics/rhapsody   "/usr/bin/tini -- /b…"   23 seconds ago      Exited (0) 22 seconds ago                       confident_cannon
521eca72fa0f        bdgenomics/rhapsody   "/usr/bin/tini -- /b…"   7 minutes ago       Up 7 minutes                                    agitated_swirles
095cf158a83e        c5d48e81b986          "/bin/bash"              8 days ago          Up 29 hours                                     test_sge_sjm

$docker start 521eca72fa0f 

$docker exec -it 521eca72fa0f /bin/bash

在docker内启动Jupyter Notebook且在浏览器中能被打开

jupyter notebook --ip 0.0.0.0 --no-browser --allow-root --port 8888 &
上一篇下一篇

猜你喜欢

热点阅读