美文网首页
Docker cheatsheet

Docker cheatsheet

作者: n5ken | 来源:发表于2017-05-04 17:11 被阅读0次

    From: https://docs.docker.com

    Build an image:

    $ docker build -t [image-name] [path]

    Run an image:

    $ docker run [image-name]

    Show all images:

    $ docker images

    Run an image with port mapping, mapping machine’s port 4000 to the container’s EXPOSEd port 80 using -p:

    # docker run -p [dest]:[source] [image-name]

    $ docker run -p 4000:80 friendlyhello

    Adding -d to run in background:

    $ docker run -d -p 4000:80 friendlyhello

    Show all running container processes:

    $ docker ps

    CONTAINER ID        IMAGE              COMMAND            CREATED

    1fa4ab2cf395          friendlyhello        "python app.py"       28 seconds ago

    Stop a container process:

    $ docker stop [process id]

    相关文章

      网友评论

          本文标题:Docker cheatsheet

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