其他分享
首页 > 其他分享> > Docker速成

Docker速成

作者:互联网

1。安装

        curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
        也可以使用国内 daocloud 一键安装命令:

        curl -sSL https://get.daocloud.io/docker | sh

2。docker run -itd dockname /bin/bash

        -d后台 -i交互 -t终端

        docker stop dockname/id
        docker rm dockename

3。修改镜像:
        docker run -it --name mytest test /bin/bash

        从主机复制到容器sudo docker cp host_path containerID:container_path

        从容器复制到主机sudo docker cp containerID:container_path host_path
        修改该后exit退出。
4。重新运行:
          docker start mytest

        docker exec -it mytest /bin/bash

        打开同一container
5。保存镜像
                docker commit mytest test

        制作镜像文件:
                docker test >./ test.rar

        打开镜像

                docker load < ./test.rar

标签:container,mytest,速成,test,path,Docker,docker,bash
来源: https://blog.csdn.net/qq_35398543/article/details/122414357