我按照docker说明安装并验证了docker安装(来自http://docs.docker.com/linux/step_one/).
我尝试了2台Ubuntu 14.04机器,在启动docker守护程序时我遇到了以下错误:
$ sudo docker daemon
INFO[0000] Listening for HTTP on unix (/var/run/docker.sock)
INFO[0000] [graphdriver] using prior storage driver "aufs"
INFO[0000] Option DefaultDriver: bridge
INFO[0000] Option DefaultNetwork: bridge
WARN[0000] Running modprobe bridge nf_nat br_netfilter failed with message: modprobe: WARNING: Module br_netfilter not found. , error: exit status 1
INFO[0000] Firewalld running: false
WARN[0000] Your kernel does not support cgroup memory limit: mountpoint for memory not found
WARN[0000] mountpoint for cpu not found
FATA[0000] Error starting daemon: Devices …Run Code Online (Sandbox Code Playgroud) 我是Gherkin语言的新手,这对我来说似乎是非常基本的问题,但我找不到答案.
我知道可以在Gherking中编写多行步骤参数,如下所示:
Given a blog post named "Random" with Markdown body
"""
Some Title, Eh?
==============
Here is the first paragraph of my blog post. Lorem ipsum dolor sit amet,
consectetur adipiscing elit.
"""
Run Code Online (Sandbox Code Playgroud)
我的问题是关于在多行上编写单步,如下所示:
Given that Gherkin language allows me to write my step definitions \
on multiple lines
Then my test cases would be easier to read :)
Run Code Online (Sandbox Code Playgroud)
在上面的例子中,我使用'\'作为行继续符号.顺便说一句,我尝试了上面的例子并得到了解析器错误.
这是我试图实现的目标.我有两个dockerfiles,它们完全相同,唯一的区别是FROM语句.一个基于CentOS,另一个基于RHEL.我遇到的问题是,每当我在一个文件中修改某些内容时,我必须在另一个文件中执行相同操作,因为它们必须相同.
对此的一个解决方案是将基础映像作为参数传递给docker build命令.我不知道这是否可能.
另一种方法是拥有某种包含文件机制.在这种情况下,我将在一个单独的文件中实现所有常见步骤,我将只包含在我的dockerfiles中.
也许还有其他方式.
有什么建议值得欢迎吗?
我有以下Dockerfile:
FROM ubuntu:16.04
ARG path1=def_path1
RUN mkdir ${path1}
Run Code Online (Sandbox Code Playgroud)
当我使用以下命令构建此Dockerfile时:
docker build --build-arg path1=/home/dragan -t build_arg_ex .
Run Code Online (Sandbox Code Playgroud)
在Windows 10的MINGW bash中执行该错误时,出现以下错误:
$ ./build.sh --no-cache
Sending build context to Docker daemon 6.144kB
Step 1/3 : FROM ubuntu:16.04
---> 2a4cca5ac898
Step 2/3 : ARG path1=def_path1
---> Running in a35241ebdef3
Removing intermediate container a35241ebdef3
---> 01475e50af4c
Step 3/3 : RUN mkdir ${path1}
---> Running in 2759e683cbb1
mkdir: cannot create directory 'C:/Program': No such file or directory
mkdir: cannot create directory 'Files/Git/home/dragan': No such file or …Run Code Online (Sandbox Code Playgroud) 我有以下步骤定义(只是为了说明我的问题):
When(/^the calculator is run$/) do
step %{When xxx the calculator is run xxx}
end
When(/^xxx the calculator is run xxx$/) do
@output = `ruby calc.rb #{@input}`
raise('Command failed!') unless $?.success?
end
Run Code Online (Sandbox Code Playgroud)
在我的功能文件中,当我打电话时:
When the calculator is run
Run Code Online (Sandbox Code Playgroud)
我收到了错误消息:
Undefined dynamic step: "When xxx the calculator is run xxx" (Cucumber::UndefinedDynamicStep)
./features/step_definitions/calculator_steps_when.rb:2:in `/^the calculator is run$/'
features/adding.feature:11:in `When the calculator is run'
features/adding.feature:6:in `When the calculator is run'
Run Code Online (Sandbox Code Playgroud)
根据文档,这应该工作.最初我有不同文件中的步骤,并认为我可能必须提供一些include指令,但现在即使步骤在同一个文件中也会发生.我错过了什么?
谢谢
docker ×3
cucumber ×2
bash ×1
dockerfile ×1
gherkin ×1
mingw ×1
ruby ×1
ubuntu-14.04 ×1
windows ×1