• Docker Machine


    Docker Machine 是docker三剑客之一,可以快速的创建多台docker虚拟机

    环境:我的环境是windows 10 安装的 VMware  里面安装的Centos7

    一、VirtualBox

    1、epel源、VirtualBox源

    yum -y install epel-release
    cd /etc/yum.repos.d/
    wget https://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo

    注:如果你是和我一样安装的mini版本 需要安装wget(-bash: wget: command not found

    yum install -y wget

    2、安装指定版本VirtualBox

    yum search virtualbox
    yum -y install VirtualBox-6.0

    二、安装Docker Machine

    可以到https://github.com/docker/machine/releases看到所有发布版本,我们这里安装Linux版本

    curl -L https://github.com/docker/machine/releases/download/v0.16.2/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine &&
        chmod +x /tmp/docker-machine &&
        sudo cp /tmp/docker-machine /usr/local/bin/docker-machine

    三、使用Docker Machine

    1、创建虚拟机

    docker-machine create --driver virtualbox myBox

    或指定参数(具体参数可以查看 docker-machine --help)

    docker-machine create -d virtualbox  
    --virtualbox-disk-size 30000 
    --virtualbox-cpu-count 2 
    --virtualbox-memory 2048 
    myBox

    或同时创建多个

    for NODE in `seq 1 5`; do docker-machine create --driver virtualbox "node-${NODE}"; done

    2、使用

    查看虚拟机信息

    docker-machine env myBox

    进入虚拟机

    docker-machine ssh myBox

    查看虚拟机列表

    docker-machine ls

    注:如果安装过程顺利,按以上步骤就可以正常使用了,下面我备注一下我安装遇到的问题,如果你也遇到了希望能互相学习

    错误1

    Error with pre-create check: "We support Virtualbox starting with version 5. Your VirtualBox install is "WARNING: The vboxdrv kernel module is not loaded. Either there is no module
    available for the current kernel (3.10.0-957.el7.x86_64) or it failed to
    load. Please recompile the kernel module and install it by
    sudo /sbin/vboxconfig
    You will not be able to start VMs until this problem is fixed.\n6.0.14r133895". Please upgrade at https://www.virtualbox.org"

    解决办法:sudo /sbin/vboxconfig

    错误2

    vboxdrv.sh: Stopping VirtualBox services.
    vboxdrv.sh: Starting VirtualBox services.
    vboxdrv.sh: Building VirtualBox kernel modules.
    This system is currently not set up to build kernel modules.
    Please install the gcc make perl packages from your distribution.
    Please install the Linux kernel "header" files matching the current kernel
    for adding new hardware support to the system.
    The distribution packages containing the headers are probably:
        kernel-devel kernel-devel-3.10.0-957.el7.x86_64
    This system is currently not set up to build kernel modules.
    Please install the gcc make perl packages from your distribution.
    Please install the Linux kernel "header" files matching the current kernel
    for adding new hardware support to the system.
    The distribution packages containing the headers are probably:
        kernel-devel kernel-devel-3.10.0-957.el7.x86_64
    
    There were problems setting up VirtualBox.  To re-start the set-up process, run
      /sbin/vboxconfig
    as root.  If your system is using EFI Secure Boot you may need to sign the
    kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load
    them. Please see your Linux system's documentation for more information.

    解决办法:依次执行以下语句

    1、yum update kernel -y

    2、reboot(重启centos)

    3、yum install kernel-headers kernel-devel gcc make -y

    错误3

    Error with pre-create check: "This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory"

    解决办法:我这里是VMware 把这一项勾选上

  • 相关阅读:
    RTMP协议在线教育课堂web视频直播点播平台EasyDSS鉴权模块优化说明
    RTMP协议在线教育课堂web视频直播点播平台EasyDSS在大量设备开启录像后为什么会导致系统卡死?
    RTMP协议视频直播点播智能分析平台EasyDSS优化视频水印生成效率参考
    互联网在线课堂直播点播视频平台EasyDSS访问页面报NO DSS SERVICE如何排查?
    RTMP直播点播平台EasyDSS下载录像文件为什么会提示:最大播放下载录像间隔是3小时?
    RTMP协议互联网教育课堂直播点播系统EasyDSS获取直播信息优化设计方案介绍
    如何将RTMP协议视频直播点播平台EasyDSS录像文件存储在其他的空闲磁盘内?
    POJ 3069 Saruman's Army 贪心
    POJ3617 Best Cow line 简单题
    POJ 1852 Ants 思维题 简单题
  • 原文地址:https://www.cnblogs.com/fanxp/p/11802549.html
Copyright © 2020-2023  润新知