- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 Vagrant box boot2docker(在 Windows 8.1 上)中将 Drupal 作为 Docker 容器运行:
Vagrant 文件 (我的 Docker 容器)
# -*- 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.hostname = "docker-host"
config.vm.box = "hashicorp/boot2docker"
config.vm.network "forwarded_port", guest: 80, host: 8080
end
vagrant up
在我的 Docker 容器的目录中运行它(和主机):
$ 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 Docker
default: host. You'll see the output of the `vagrant up` for this VM below.
default:
default: Importing base box 'hashicorp/boot2docker'...
default: Matching MAC address for NAT networking...
default: Checking if box 'hashicorp/boot2docker' is up to date...
default: Setting the name of the VM: boot2docker_default_1463064065066_29287
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: password
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Machine booted and ready!
GuestAdditions versions on your host (5.0.20) and guest (4.3.28 r100309) do not match.
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 4.3.28 r100309
mkdir: can't create directory '/tmp/selfgz98932600': No such file or directory
Cannot create target directory /tmp/selfgz98932600
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: Setting hostname...
==> 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
default:
default: Container created: d12499a52f3d3f27
==> default: Starting container...
==> default: Provisioners will not be run since container doesn't support SSH.
$ vagrant ssh
==> default: SSH will be proxied through the Docker virtual machine since we're
==> default: not running Docker natively. This is just a notice, and not an error.
==> default: The machine you're attempting to SSH into is configured to use
==> default: password-based authentication. Vagrant can't script entering the
==> default: password for you. If you're prompted for a password, please enter
==> default: the same password you have configured in the Vagrantfile.
docker@127.0.0.1's password: tcuser
ssh: connect to host 172.17.0.1 port 22: Connection refused
Connection to 127.0.0.1 closed.
$ vagrant global-status
id name provider state directory
----------------------------------------------------------------------------------------------
e4da5ae default virtualbox running c:/my-project-path/host/boot2docker
98ef037 default docker running c:/my-project-path
The above shows information about all known Vagrant environments
on this machine. This data is cached and may not be completely
up-to-date. To interact with any of the machines, you can go to
that directory and run Vagrant, or you can use the ID directly
with Vagrant commands from any directory. For example:
"vagrant destroy 1a2b3c4d"
$ vagrant ssh 98ef037
==> default: SSH will be proxied through the Docker virtual machine since we're
==> default: not running Docker natively. This is just a notice, and not an error.
==> default: The machine you're attempting to SSH into is configured to use
==> default: password-based authentication. Vagrant can't script entering the
==> default: password for you. If you're prompted for a password, please enter
==> default: the same password you have configured in the Vagrantfile.
docker@127.0.0.1's password: tcuser
ssh: connect to host 172.17.0.3 port 22: Connection refused
Connection to 127.0.0.1 closed.
docker.has_ssh = true
到 Vagrantfile (我很困惑是否需要它,因为我可以调用
vagrant ssh
没有它):
# -*- 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'
docker.has_ssh = true
end
config.vm.synced_folder ".", "/vagrant", type: "smb", disabled: true
end
$ vagrant reload
==> default: Stopping container...
==> default: Starting container...
==> default: Waiting for machine to boot. This may take a few minutes...
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
vagrant ssh
连接到我的 Docker 容器? ?
$ cd host
$ vagrant ssh
==> default: The machine you're attempting to SSH into is configured to use
==> default: password-based authentication. Vagrant can't script entering the
==> default: password for you. If you're prompted for a password, please enter
==> default: the same password you have configured in the Vagrantfile.
docker@127.0.0.1's password: tcuser
## .
## ## ## ==
## ## ## ## ## ===
/"""""""""""""""""\___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\_______/
_ _ ____ _ _
| |__ ___ ___ | |_|___ \ __| | ___ ___| | _____ _ __
| '_ \ / _ \ / _ \| __| __) / _` |/ _ \ / __| |/ / _ \ '__|
| |_) | (_) | (_) | |_ / __/ (_| | (_) | (__| < __/ |
|_.__/ \___/ \___/ \__|_____\__,_|\___/ \___|_|\_\___|_|
Boot2Docker version 1.7.0, build master : 7960f90 - Thu Jun 18 18:31:45 UTC 2015
Docker version 1.7.0, build 0baf609
docker@docker-host:~$ sudo docker exec -t -i drupal-container /bin/bash
root@d12499a52f3d:/var/www/html#
vagrant ssh
在容器的目录下连接容器(常见的 Vagrant 工作流)。
最佳答案
您运行 docker 容器而不是虚拟机作为您的提供者,因此 vagrant 工作流程被破坏,因为您无法 ssh 进入 docker 容器。
当您使用 docker 提供程序时,您可以使用 vagrant docker-run
运行您的命令。 ;见doc
如果你直接运行docker,你将无法直接ssh,有一些hacks解决这个问题,但是作为提供者的抽象的 vagrant 不能使它成为一个简单的 ssh
命令及其不是官方支持。
关于drupal - Vagrant ssh 到 Docker 容器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37191371/
是否有一个 drupal 模块可以在 drupal 站点中启用实时聊天? 最佳答案 我推荐drupalchat ,它是维护最完善、最完整的版本。它使用 node.js作为服务器。它适用于 Drupal
在 Drupal 中,;$Id$ 是什么? ? 我知道我们在 .info 文件中使用它,它告诉 Drupal 我们的模块信息。 我的问题是为什么 ;$Id$必要的? 最佳答案 $Id$ 是并发版本系统
我有一个 Drupal 模块“示例”。我已将模块的管理和客户端功能拆分为两个包含文件 example.admin.inc 和 example.pages.inc。我在 example.module 文
我的网页中有几种表单,并且我希望能够向所有提交按钮添加一个类(现在我已经将表单提交作为标准)。而且,在某些表单中,我具有使用AHAH来显示内容的按钮,但我不希望这些按钮具有新类,仅希望那些在表单上进行
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题? Update the question所以它是on-topic对于堆栈溢出。 10年前关闭。 Improve this qu
是否有用户可以喜欢或不喜欢的 Drupal 模块,并喜欢该节点?比如 stackoverflow 的按钮? tnx。 最佳答案 Vote Up/Down module很像 StackOverflow
我没有找到如何在管理模式下的 drupal 页面列表中添加元描述以提高我的 SEO SEO metadescription pages list drupal我能做什么? 最佳答案 使用元标记模块自动
我想学习如何在 drupal- 模块中创建模块,这些模块可以与用户、数据库、分配权限、 View 交互。 是否有任何好的视频教程或简单的示例模块可以涵盖这些内容? 谢谢。 最佳答案 我的建议是获取 P
我正在 Drupal 中创建信用卡表格。我需要一个日期选择字段,用户可以在其中选择他们的信用卡到期日期,该日期仅包含月份和年份 - 没有日期。 Drupal 表单 #type 'date' 产生一个日
如何覆盖drupal主页的node.tpl文件?我尝试了各种 node--front.tpl.php page--node--front.tpl.php page--front--n
这个问题不太可能帮助任何 future 的访客;它仅与一个小地理区域、一个特定时刻或一个非常狭窄的情况相关,而这些情况通常不适用于互联网的全局受众。如需帮助使这个问题更广泛地适用,visit the
是否有按类别对内容进行分组的好方法。 我希望我可以有一个 CCK 类别字段。 最佳答案 使用分类法。它与 View 有很好的集成。我们用它在我们的投资组合上按分类词对投资组合项目进行分组。 http:
我有带 CCK 的 Drupal, 我有一个名为 Article 的内容类型。 本文有 5 个节点引用。 我正在使用 CCK 中的表字段,我正在尝试将其连接到 引用文献,所以每篇文章[包含一个表格字段
一个网站已经运行了一段时间。但是最近,当我上传图片时,它总是会引发这个错误: An unrecoverable error occurred. This form was missing from t
所以 Drupal 6 的一个麻烦是很难将更改从开发服务器转移到测试服务器或登台服务器到生产服务器。 这在 Drupal 7 中变得更容易了吗?模块开发人员现在应该遵循一些编码约定吗?所以开发人员可以
我正在为我的drupal 7网站编写一个包装器类,它使我可以连接到并查询我的phpbb数据库。 当连接到外部数据源时(根据drupal文档),您已经设置了事件数据库,运行查询,然后将事件数据库设置回默
如何在drupal菜单项中将页面参数之一设置为可选页面参数? 我有 $items['activities_list/%/%']=array( 'title callback' => 'activiti
我正在运营一个网站 xyz.org在 Drupal 中。 现在我想安装一些其他模块,例如 PHPBB 论坛和铜矿 画廊。当我安装这些并尝试访问链接 xyz.org/gallery 时,它给了我 dru
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
我想获取一个字段的图像路径。我在节点中,我需要图像的Url才能将其作为背景图像放入内嵌CSS中。 我找不到解决方案。你能帮助我吗? 最佳答案 要从URI中获取图像的路径: file_create_ur
我是一名优秀的程序员,十分优秀!