docker 启动容器

  • docker 生成本地image

    docker commit -a ephuizi -m “myapp 4.1.5 version” 993448234d20 myrep/myapp:4.1.5

  • 创建网桥,划分子网

    docker network create –subnet=172.18.0.0/16 mynetwork

  • 启动容器

    指定网络,特权,共享主机device,退出时删除
    docker run –name hui3 –network=mynetwork –ip 172.18.0.12 –cap-add SYS_ADMIN –device /dev/fuse –security-opt apparmor=unconfined -it –rm myrep/myapp:4.1.5 /bin/bash

  • 连接容器

    docker -exec -it 862f428a014c /bin/bash

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.