我尝试运行Drupal作为Docker容器在Vagant box boot2docker(在Windows 8.1)。
Vagrantfile(Drupal容器)
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.provider "docker" do |docker|
docker.vagrant_vagrantfile = "host/Vagrantfile"
docker.image = "drupal"
docker.ports = ['80:80']
docker.name = 'drupal-container'
end
config.vm.synced_folder ".", "/vagrant", type: "smb", disabled: true
end
主机/Vagrantfile(boot2docker)
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "mitchellh/boot2docker"
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.provision "docker"
config.vm.hostname = "docker-host"
end
在Drupal容器的目录中运行流浪者向上
会导致错误,因为找不到Drupal映像。
输出
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 Docker
default: host. You'll see the output of the `vagrant up` for this VM below.
default:
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: boot2docker_default_1463038875167_93224
default: Clearing any previously set network interfaces...
default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Forwarding ports...
default: 2375 (guest) => 2375 (host) (adapter 1)
default: 80 (guest) => 8080 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (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:2222
default: SSH username: docker
default: SSH auth method: private key
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: 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 it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
default: Machine booted and ready!
No installation found.
The guest's platform ("tinycore") is currently not supported, will try generic Linux method...
Copy iso file C:\Program Files/Oracle/VirtualBox/VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso
Installing Virtualbox Guest Additions 5.0.20 - guest version is unknown
mkdir: can't create directory '/tmp/selfgz80627365': No such file or directory
Cannot create target directory /tmp/selfgz80627365
You should try option --target OtherDirectory
An error occurred during installation of VirtualBox Guest Additions 5.0.20. Some functionality may not work as intended.
In most cases it is OK that the "Window System drivers" installation failed.
default: Checking for guest additions in VM...
default: No guest additions were detected on the base box for this VM! Guest
default: additions are required for forwarded ports, shared folders, host only
default: networking, and more. If SSH fails on this machine, please install
default: the guest additions and repackage the box to continue.
default:
default: This is not an error message; everything may continue to work properly,
default: in which case you may ignore this message.
default: Setting hostname...
default: Running provisioner: docker...
==> default: Warning: When using a remote Docker host, forwarded ports will NOT be
==> default: immediately available on your machine. They will still be forwarded on
==> default: the remote machine, however, so if you have a way to access the remote
==> default: machine, then you should be able to access those ports there. This is
==> default: not an error, it is only an informational message.
==> default: Creating the container...
default: Name: drupal-container
default: Image: drupal
default: Port: 80:80
A Docker command executed by Vagrant didn't complete successfully!
The command run along with the output from the command is shown
below.
Command: "docker" "run" "--name" "drupal-container" "-d" "-p" "80:80" "drupal"
Stderr: Unable to find image 'drupal' locally
Pulling repository drupal
2016/05/12 07:42:05 Could not reach any registry endpoint
Stdout:
它的工作原理,如果我将主机的方框更改为ubuntu/Trust y64
主机/虚拟文件(ubuntu/trusty64)
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.provision "docker"
config.vm.hostname = "docker-host"
end
但我喜欢使用boot2docker,因为它更轻量级。
我的流浪配置怎么了?如何让boot2docker框作为主机工作?
我实际上无法让您的配置工作,但我已经测试了mitchellh/boot2docker框并发现了问题。该框内docker version
的输出为:
Client version: 1.2.0
Client API version: 1.14
Go version (client): go1.3.1
Git commit (client): fa7b24f
OS/Arch (client): linux/amd64
Server version: 1.2.0
Server API version: 1.14
Go version (server): go1.3.1
Git commit (server): fa7b24f
这个版本的docker非常过时,现在根本无法从docker中心提取图像。你可以在这里看到docker团队宣布弃用的地方:https://blog.docker.com/2015/10/docker-hub-deprecation-1-5/
目前你必须有docker
这是我第一次尝试设置docker(版本17.09.0-ce)。我已经按照官方网站的所有说明在我的机器(Windows10x64)上运行正常。当我在控制台上键入时,返回。但我正在尝试执行docker run-t hello world,答案如下: 我的互联网来自代理,但我制作了一个VPN,所有东西都工作得很好,除了docker,我甚至使用pip安装python软件包。有什么不对劲吗?
我正在使用docker。当我这样做时:docker图像。我看到了这个: 但是,当我尝试使用此命令启动容器时: 我得到这个错误: 找不到图像“hello-world/hello-world-python: 0.0.0。释放”本地docker:守护程序的错误响应:拒绝对hello-world/hello-world-python的拉取访问,存储库不存在或可能需要“docker login”:拒绝:拒绝
maven偶尔会抱怨,在构建另一个将特定依赖项作为依赖项的项目时,无法在本地存储库中找到在本地构建和打包的特定依赖项。我们得到如下错误: 未能在项目X上执行目标:无法解析项目X的依赖关系:未能在[存档存储库]中找到Y,已缓存在本地存储库中,在内部的更新间隔过去或强制更新之前,不会重新尝试解析-> 唯一可行的两件事是等待很长时间直到maven变得聪明起来,或者完全删除本地存储库。假定等待选项与前述更
我有一个简单的Spring Boot应用程序。我试图用jib maven插件创建它的docker图像。但当我构建这个应用程序时,它失败了,出现了401个未经授权的异常。但是我在日志中正确地给出了所有配置,我可以看到它被正确地读取了,但是在推送其失败时,图像出现了I/O错误。。 我正在使用
在我的程序中,src目录下列出了三个文件夹:文件、声音、图像。我不知道为什么我的代码没有被检测到。当我运行这个程序时,我收到了这样一条消息:“java.io.FileNotFoundException:files\7.txt(系统找不到指定的路径)”。我有图片附在这里。请帮忙。 下面是我的代码: 关于文件File=新文件(resource.toURI());以下是我尝试过但仍然无效的内容: 下面是
我需要设置公司代理,以便Docker可以从公共注册表下载图像。 我使用Ubuntu 12.04机器。我找到了这个答案,但是在Ubuntu 12.04中不存在。我该怎么做呢? 谢谢