【发布时间】:2015-09-15 12:05:26
【问题描述】:
这是一个简单的节点应用程序示例,它在我的机器上运行正常;-), 在本地,我使用脚本 deploy_local.sh 启动容器,我得到:
$ ./deploy_local.sh
Target is local host. Invoking docker with the given arguments...
Untagged: example:latest
Target is local host. Invoking docker with the given arguments...
Pulling repository registry-ice.ng.bluemix.net/ibmnode
...
Status: Image is up to date for registry-ice.ng.bluemix.net/ibmnode:latest
Target is local host. Invoking docker with the given arguments...
Sending build context to Docker daemon 6.656 kB
...
Successfully built 83d92bb3ff5f
Target is local host. Invoking docker with the given arguments...
flag provided but not defined: -f
See '/usr/bin/docker --help'.
Target is local host. Invoking docker with the given arguments...
OI
$
在本地拥有图像,然后我尝试将其推送到 bluemix,成功:
$ ice --local push registry-ice.ng.bluemix.net/techdays/example
Target is local host. Invoking docker with the given arguments...
The push refers to a repository [registry-ice.ng.bluemix.net/techdays/example] (len: 1)
Sending image list
...
Image 4f7397e97d5c already pushed, skipping
Pushing tag for rev [83d92bb3ff5f] on {https://registry-ice.ng.bluemix.net/v1/repositories/techdays/example/tags/latest}
$
但是当我尝试运行它时:
$ ice run --name example registry-ice.ng.bluemix.net/techdays/example
Command failed with container cloud service
{
"id": "IC0000",
"incident_id": "37295f32b40079a8",
"message": "Sorry, an error occurred on our side. Please reference the problem using the provided incident ID.",
"name": "DefaultError",
"type": "General"
}
$
有人经历过吗?
我的工具版本:
$ ice version
ICE CLI Version : 2.0.1 271 2015-03-30T15:40:18
$ docker --version
Docker version 1.5.0, build a8a31ef
-- dockerfile--
FROM registry-ice.ng.bluemix.net/ibmnode:latest
WORKDIR /
RUN mkdir -p /app
ADD dist /app
WORKDIR /app
CMD ["node", "app.js"]
-- app.js--
console.log('OI');
-- deploy_local.sh--
#!/bin/sh
CONTAINER_NAME=example
REGISTRY=registry-ice.ng.bluemix.net
ORG=techdays
ice --local pull $REGISTRY/ibmnode
ice --local build -t $CONTAINER_NAME .
ice --local -f tag $CONTAINER_NAME $REGISTRY/$ORG/$CONTAINER_NAME
ice --local run $CONTAINER_NAME
【问题讨论】:
-
如果 app.js 所做的只是记录一件事,由于进程几乎立即退出,这不会被视为问题吗?
flag provided but not defined: -f是关于什么的? -
...-f 是为了强制对图像进行标记,但是在本地它没有任何效果,因为我们实际上得到了容器的输出: OI ...无论如何,如果它是没问题 为什么命令失败了?
-
刚刚将应用程序更改为快速服务器,打印相同的日志消息和相同的结果。不得不说我已经为这个测试示例创建了一个新空间,但现在我已经变回了我以前的空间,并且构建并启动了容器并且......它工作了!那里的空格有些奇怪,毫无头绪,这些错误消息无济于事,对正在发生的事情一无所知。