zoukankan      html  css  js  c++  java
  • docker安装

    系统要求:需要一个64位的centos7操作系统和版本3.10或更高版本的Linux内核

    开始安装:

    uname -r       //查看内核版本
    yum -y update   //更新系统更新到最新

    #安装docker
    yum install docker-engine

    systemctl enable docker.service   //启用该服务
    systemctl start docker   //启动docker

      

    安装完成创建一个镜像到容器里测试下:

    运行: docker run --rm hello-world

    出现下面信息表示创建成功:
    Unable to find image 'hello-world:latest' locally
    latest: Pulling from library/hello-world
    c04b14da8d14: Pull complete
    Digest: sha256:0256e8a36e2070f7bf2d0b0763dbabdd67798512411de4cdcf9431a1feb60fd9
    Status: Downloaded newer image for hello-world:latest

    Hello from Docker!
    This message shows that your installation appears to be working correctly.

    To generate this message, Docker took the following steps:
    1. The Docker client contacted the Docker daemon.
    2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
    4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

    To try something more ambitious, you can run an Ubuntu container with:
    $ docker run -it ubuntu bash

    Share images, automate workflows, and more with a free Docker Hub account:
    https://hub.docker.com

    For more examples and ideas, visit:
    https://docs.docker.com/engine/userguide/

    查看本地镜像:

    docker images

    拉取镜像:
    docker pull centos:7.2.1511

    centos镜像官方地址:
    https://hub.docker.com/_/centos/

     如果拉取镜像报下面提示,可以修改服务器的dns试下:

    114.114.114.114   202.101.224.69

    删除none镜像:

    docker ps -a | grep "Exited" | awk '{print $1 }'|xargs docker stop
    docker ps -a | grep "Exited" | awk '{print $1 }'|xargs docker rm
    docker images|grep none|awk '{print $3 }'|xargs docker rmi

    删除镜像参考文档地址:http://www.tuicool.com/articles/R7jMZfq
     
  • 相关阅读:
    数据库索引(Oracle和Mysql)学习总结
    个人开源Git地址
    关于SQL优化这些你了解吗?
    Java项目排查cpu负载高
    Java Bean与Map之间相互转化的实现
    Maven项目改为spring boot项目的方法
    spring boot从redis取缓存发生java.lang.ClassCastException异常
    MySQL优化之Explain命令解读
    阿里巴巴校招四面经验分享
    HDBS之应用代码优化
  • 原文地址:https://www.cnblogs.com/kangleweb/p/6232954.html
Copyright © 2011-2022 走看看