电子购物网站建设视频,邢台房产信息网58同城,凡科互动投票,wordpress企业末班什么是无业游民#xff1f; Vagrant是创建虚拟开发环境的简化且可移植的方式。 它可与多种虚拟化软件一起使用#xff0c;例如VirtualBox#xff0c;VMWare#xff0c;AWS等。 它还可以与多种配置软件一起使用#xff0c;例如Ansible#xff0c;Chef#xff0c;Puppet或… 什么是无业游民 Vagrant是创建虚拟开发环境的简化且可移植的方式。 它可与多种虚拟化软件一起使用例如VirtualBoxVMWareAWS等。 它还可以与多种配置软件一起使用例如AnsibleChefPuppet或Salt。 不再需要“在我的机器上工作” 通常提供者是通常的。 从1.6版开始Docker容器也可以用作后端提供程序之一。 这使您的开发环境可以基于Docker容器而不是完整的虚拟机。 在docs.vagrantup.com/v2/docker/index.html上了解有关此内容的更多信息。 完整的开发环境定义例如机器类型需要安装的软件网络和其他配置信息在文本文件通常称为Vagrantfile 。 基于提供者它创建了虚拟开发环境。 在docs.vagrantup.com/v2/vagrantfile/index.html上了解有关文件中定义内容以及方法的更多信息。 流浪汉入门 入门指南非常简单易于遵循让Vagrant弄湿你的脚。 创建基本定义后即可使用简单的命令启动环境 vagrant up 完整的命令集在docs.vagrantup.com/v2/cli/index.html上定义。 Vagrant的默认提供程序是VirtualBox。 可以在CLI上将备用提供程序指定为 vagrant up --providerdocker 这将根据Vagrantfile中指定的映像启动Docker容器。 包装形式 无业游民的环境被打包为Boxs 。 您可以从公开可用的框列表中进行搜索以找到所需的框。 甚至创建自己的盒子并使用以下命令将它们添加到中央存储库 vagrant box add USER/BOX流浪于WildFly Docker映像 学习完基本命令后让我们看看使用Vagrant启动WildFly Docker映像需要做什么。 所述Vagrantfile在定义github.com/arun-gupta/vagrant-images/blob/master/docker-wildfly/Vagrantfile和在线所示 Vagrant.configure(2) do |config|config.vm.provider docker do |d|# Define the Docker imaged.image jboss/wildfly:latestend
end 克隆git repo并更改为docker-wildfly目录。 可以使用以下命令启动流浪图像 vagrant up --providerdocker 并将输出显示为 docker-wildfly vagrant up
Bringing machine default up with docker provider...default: Docker host is required. One will be created if necessary...default: Vagrant will now create or start a local VM to act as the Dockerdefault: host. Youll see the output of the vagrant up for this VM below.default: default: Box mitchellh/boot2docker could not be found. Attempting to find and install...default: Box Provider: virtualboxdefault: Box Version: 0default: Loading metadata for box mitchellh/boot2dockerdefault: URL: https://atlas.hashicorp.com/mitchellh/boot2dockerdefault: Adding box mitchellh/boot2docker (v1.2.0) for provider: virtualboxdefault: Downloading: https://atlas.hashicorp.com/mitchellh/boxes/boot2docker/versions/1.2.0/providers/virtualbox.boxdefault: Successfully added box mitchellh/boot2docker (v1.2.0) for virtualbox!default: Importing base box mitchellh/boot2docker...default: Matching MAC address for NAT networking...default: Checking if box mitchellh/boot2docker is up to date...default: Setting the name of the VM: docker-host_default_1421277252359_12510default: Fixed port collision for 22 2222. Now on port 2203.default: Clearing any previously set network interfaces...default: Preparing network interfaces based on configuration...default: Adapter 1: natdefault: Forwarding ports...default: 2375 2375 (adapter 1)default: 22 2203 (adapter 1)default: Running pre-boot VM customizations...default: Booting VM...default: Waiting for machine to boot. This may take a few minutes...default: SSH address: 127.0.0.1:2203default: SSH username: dockerdefault: SSH auth method: private keydefault: Warning: Connection timeout. Retrying...default:default: Vagrant insecure key detected. Vagrant will automatically replacedefault: this with a newly generated keypair for better security.default:default: Inserting generated public key within guest...default: Removing insecure key from the guest if its present...default: Key inserted! Disconnecting and reconnecting using new SSH key...default: Machine booted and ready!default: Syncing folders to the host VM...default: Installing rsync to the VM...default: Rsyncing folder: /Users/arungupta/workspaces/vagrant-images/docker-wildfly/ /var/lib/docker/docker_1421277277_78698default: Warning: When using a remote Docker host, forwarded ports will NOT bedefault: immediately available on your machine. They will still be forwarded ondefault: the remote machine, however, so if you have a way to access the remotedefault: machine, then you should be able to access those ports there. This isdefault: not an error, it is only an informational message.default: Creating the container... 在固定5187之前该功能将不起作用。 但是至少该博客解释了Vagrant的主要概念。 翻译自: https://www.javacodegeeks.com/2015/01/vagrant-with-docker-provider-using-wildfly-and-java-ee-7-image.html