BCLinux开源软件镜像手册-Docker运行环境


  • BCLinux Developers

    BCLinux开源软件镜像手册-Docker运行环境

    产品描述

    本镜像承载了近期最火的Docker,使用BCLinux作为操作系统,实例启动后,docker daemon将自动运行,而无需配置。 Docker是一个开源项目,诞生于2013年初,最初是dotCloud公司内部的一个业余项目。它基于Google公司推出的Go语言实现。Docker以Linux容器LXC为基础,实现轻量级的操作系统虚拟化解决方案。在LXC的基础上Docker进行了进一步的封装,让用户不需要去关心容器的管理,使得操作更为简便。用户操作Docker的容器就像操作一个快速轻量级的虚拟机一样简单。

    环境说明

    • 操作系统:BigCloud Enterprise Linux 7
    • 软件列表:
      • docker-1.10.3

    软件配置

    • Docker主配置文件:/etc/sysconfig/docker
    • Docker默认数据存储目录:/var/lib/docker

    使用说明

    • 查看docker运行状态
    [root@demo-bclinux-7 ~]# systemctl status docker
    ● docker.service - Docker Application Container Engine
       Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
       Active: active (running) since Fri 2016-12-16 10:04:44 CST; 4min 32s ago
         Docs: http://docs.docker.com
     Main PID: 2093 (docker-current)
       CGroup: /system.slice/docker.service
               └─2093 /usr/bin/docker-current daemon --exec-opt native.cgroupdriver=systemd --selinux-enabled --log-driver=journald
    
    Dec 16 10:04:42 demo-bclinux-7 docker-current[2093]: time="2016-12-16T10:04:42.664336160+08:00" level=info msg="Graph migration to conten...econds"
    Dec 16 10:04:42 demo-bclinux-7 docker-current[2093]: time="2016-12-16T10:04:42.681317201+08:00" level=warning msg="Running modprobe bridge br_ne...
    Dec 16 10:04:42 demo-bclinux-7 docker-current[2093]: time="2016-12-16T10:04:42.699399986+08:00" level=info msg="Firewalld running: false"
    Dec 16 10:04:43 demo-bclinux-7 docker-current[2093]: time="2016-12-16T10:04:43.680437556+08:00" level=info msg="Default bridge (docker0) ...ddress"
    Dec 16 10:04:44 demo-bclinux-7 docker-current[2093]: time="2016-12-16T10:04:44.574038110+08:00" level=info msg="Loading containers: start."
    Dec 16 10:04:44 demo-bclinux-7 docker-current[2093]: time="2016-12-16T10:04:44.575321655+08:00" level=info msg="Loading containers: done."
    Dec 16 10:04:44 demo-bclinux-7 docker-current[2093]: time="2016-12-16T10:04:44.575340406+08:00" level=info msg="Daemon has completed init...zation"
    Dec 16 10:04:44 demo-bclinux-7 docker-current[2093]: time="2016-12-16T10:04:44.575357213+08:00" level=info msg="Docker daemon" commit=cb0...=1.10.3
    Dec 16 10:04:44 demo-bclinux-7 systemd[1]: Started Docker Application Container Engine.
    Dec 16 10:04:44 demo-bclinux-7 docker-current[2093]: time="2016-12-16T10:04:44.580819544+08:00" level=info msg="API listen on /var/run/docker.sock"
    Hint: Some lines were ellipsized, use -l to show in full.
    
    • 获取镜像:
    [root@demo-bclinux-7 ~]# docker pull centos
    Using default tag: latest
    Trying to pull repository docker.io/library/centos ...
    latest: Pulling from docker.io/library/centos
    45a2e645736c: Pulling fs layer
    latest: Pulling from docker.io/library/centos
    45a2e645736c: Pull complete
    Digest: sha256:c577af3197aacedf79c5a204cd7f493c8e07ffbce7f88f7600bf19c688c38799
    Status: Downloaded newer image for docker.io/centos:latest
    
    • 运行镜像:
    [root@demo-bclinux-7 ~]# docker run -it --rm centos /bin/bash
    [root@e114242dc037 /]# cat /etc/os-release
    NAME="CentOS Linux"
    VERSION="7 (Core)"
    ID="centos"
    ID_LIKE="rhel fedora"
    VERSION_ID="7"
    PRETTY_NAME="CentOS Linux 7 (Core)"
    ANSI_COLOR="0;31"
    CPE_NAME="cpe:/o:centos:centos:7"
    HOME_URL="https://www.centos.org/"
    BUG_REPORT_URL="https://bugs.centos.org/"
    
    CENTOS_MANTISBT_PROJECT="CentOS-7"
    CENTOS_MANTISBT_PROJECT_VERSION="7"
    REDHAT_SUPPORT_PRODUCT="centos"
    REDHAT_SUPPORT_PRODUCT_VERSION="7"
    
    • 列举镜像
    [root@demo-bclinux-7 ~]# docker images
    REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
    docker.io/centos    latest              67591570dd29        8 hours ago         191.8 MB
    

    服务管理

    • Docker:
    systemctl { enable | start | status | restart } docker