美文网首页
2018-03-19

2018-03-19

作者: phoebe_gyq | 来源:发表于2018-05-16 20:38 被阅读0次
    
    sudo docker run -i -t ubuntu /bin/bash
    ls
    ps 
    ifconfig
    https://github.com/docker/docker
    
    
    docker version
    1.Client version
    2.Server version
    3.Go version 
    
    docker search nameOfImage
    docker pull nameOfUser/nameOfImage
    docker run nameOfUser/nameOfImage echo 'hello world'
    
    docker run nameOfUser/nameOfImage apt-get install -y ping
    
    docker ps -ls
    docker commit IDNumber newNameOfUser/newNameOfImage
    docker run newNameOfUser/newNameOfImage ping www.google.com
    
    docker inspect IDNumber
    
    docker images
    
    docker push newNameOfUser/newNameOfImage
    
    
    uname -a 
    ls -l /sys/class/misc/device-mapper
    
    sudo apt-get install -y docker.io
    source /etc/bash_completio.d/docker.io
    sodu docker.io version
    
    whereis curl
    sudo apt-get install -y curl
    curl -sSL https://get.docker.com/ubuntu/ |sudo sh
    
    sudo docker version
    
    sudo docker run ubuntu echo 'hello world'
    
    sudo groupadd docker
    sudo gpasswd -a {user} docker
    sudo service docker restart
    
    
    docker run --name=container01 -i -t ubuntu /bin/bash
    docker inspect container01
    exit
    
    docker ps -a 
    
    docker rm containerName
     
    

    守护式容器

    以守护形式运行容器

    docker run -i -t IMAGE/bin/bash
    Ctrl+P Ctrl+Q
    

    附加到运行中的容器

    docker attach ID
    

    nginx

    docker run -p 80 --name web -i -t ubuntu /bin/bash
    apt-get install -y nginx
    
    apt-get install -y vim 
    
    mkdir -p /var/www/html
    cd /var/www/html
    vim index.html
    
    whereis nginx
    ls  /etc/nginx
    ls /etc/nginx/sites-enabled
    vim defalut
    
    nginx
    ps -ef
    
    
    docker ps 
    docker port  web 
    docker top web 
    curl http://127.0.0.1:49167
    docker inspect web
    
    curl http://172.17.0.32
    

    相关文章

      网友评论

          本文标题:2018-03-19

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