Docker命令

作者: 陈晓阳_矿洞程序员 | 来源:发表于2019-03-12 11:13 被阅读2次

    推荐微信公众号:【矿洞程序员】文章由高端社区fameLink创始人陶德与我及其他社区大佬联合发表。关注【矿洞程序员】可获得大咖陶德的私人微信。

    安装Docker

    apt-get remove docker docker-engine
    dpkg --configure -a
    apt-get update
    apt-get -f install
    apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
    apt-get install apt-transport-https ca-certificates curl software-properties-common
    apt-get update
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    apt-key fingerprint 0EBFCD88
    apt-get update
    apt-get install docker
    apt-get install docker.io

    执行Hello world程序

    docker run hello-world

    拉取镜像

    docker pull ubuntu:14.04

    启动容器

    docker run -it ubuntu:14.04 bash
    docker run ubuntu:14.04 /bin/echo 'Hello World'

    查看运行容器

    docker ps

    查看所有容器

    docker ps -a

    我的Github
    https://github.com/ZhangBohan

    配置加速器

    https://www.daocloud.io/mirror#accelerator-doc

    拉取镜像

    docker pull python:3.6

    创建构建代码

    mkdir composetest
    cd composetest/
    vim app.py
    vim requirements.txt
    ls
    vim Dockerfile
    vim docker-compose.yml

    安装docker-compose

    apt install docker-compose

    通过docker-compose启动

    docker-compose up


    指向.png 矿洞程序员

    相关文章

      网友评论

        本文标题:Docker命令

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