美文网首页Docker
Docker-Machine

Docker-Machine

作者: guodd369 | 来源:发表于2017-11-19 11:17 被阅读0次
    图-01
    简介

    Docker Machine是一个简化Docker安装的命令行工具,通过一个简单的命令行即可在相应的平台上安装Docker,比如VirtualBox、 Digital Ocean、Microsoft Azure。Docker官方是这样介绍Machine的初衷的:之前,Docker的安装流程非常复杂,用户需要登录到相应的主机上,根据官方的安装和配置指南来安装Docker,并且不同的操作系统的安装步骤也是不一样的。而有了Machine后,不管是在笔记本、虚拟机还是公有云实例上,用户仅仅需要一个命令....当然那你需要先安装Machine。

    解决的问题
    • 在Windows平台和MAC平台安装和运行docker
    • 搭建和管理多个docker 主机
    • 搭建swarm集群
    windows7安装

    windows 7下安装好docker后,Docker-Machine环境自动已经配置好。

    ContOS7安装

    下载地址
    参考官方文档
    配置过程

    curl -L https://github.com/docker/machine/releases/download/v0.8.2/docker-machine-`uname -s`-`uname -m` >/usr/local/bin/docker-machine && \
    chmod +x /usr/local/bin/docker-machine
    
    安装VirtualBox

    如果安装以后,你在~/.bashrc设置一下:alias dm='docker-machine'

    创建机器

    错误信息01

    Error with pre-create check: "VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path"
    

    错误信息02

    [root@iz2ze0h59yk0rf0sem4w0pz ~]# docker-machine create test
    Running pre-create checks...
    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\\n         available for the current kernel (3.10.0-693.5.2.el7.x86_64) or it failed to\\n         load. Please recompile the kernel module and install it by\\n\\n           sudo /sbin/vboxconfig\\n\\n         You will not be able to start VMs until this problem is fixed.\\n5.1.30r118389\". Please upgrade at https://www.virtualbox.org"
    
    图-02
    选择活跃主机
    运行一个Docker容器
    SSH到Docker机器中
    删除主机
    卸载

    rm ${which docker-machine}
    docker-machine rm <machine-name> docker-machine rm -f $(docker-machine ls -q)

    相关文章

      网友评论

        本文标题:Docker-Machine

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