让meteor在docker + commiting中工作,然后重新运行问题

时间:2015-10-09 01:33:44

标签: meteor docker

简短版本:

我基本上有一个运行的图像,并在其中运行流星应用程序。但是当我提交此图像然后运行这个新图像时,我的应用程序无法运行。谁能告诉我我做错了什么?或者我怎么能麻烦拍这个?

长版:

我有以下泊坞窗图片:

docker@boot2docker:~$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
meteor-todos        0.1                 30bd0cd18781        3 days ago          840.6 MB

这里我正在运行我的形象:

docker@boot2docker:~$ docker run -it --rm -p 3000:3000 meteor-todos:0.1 bash
root@5c04458cc81c:/#

在这里,我创建了我想要关注{4}}的流星应用程序:

root@5c04458cc81c:/# ls
bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
root@5c04458cc81c:/# meteor create simple-todos
Created a new Meteor app in 'simple-todos'.

To run your new app:
  cd simple-todos
  meteor

If you are new to Meteor, try some of the learning resources here:
  https://www.meteor.com/learn

它创建了simple-todos目录,因此我cd并使用命令meteor

运行应用程序
root@5c04458cc81c:/# ls
bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  simple-todos  srv  sys  tmp  usr  var
root@5c04458cc81c:/# cd simple-todos/
root@5c04458cc81c:/simple-todos# meteor
[[[[[ /simple-todos ]]]]]

=> Started proxy.
=> Started MongoDB.
=> Started your app.

=> App running at: http://localhost:3000/
^C
root@5c04458cc81c:/simple-todos#

但是,如果我然后退出此容器并将其作为图像提交。然后运行新的图像我无法让应用程序运行我得到错误。有人帮我理解这个吗?不确定它是流星的东西,码头工作者还是我和我的环境?

获取正在运行的容器的id(使用另一个boot2docker终端):

docker@boot2docker:~$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                      PORTS                    NAMES
5c04458cc81c        meteor-todos:0.1    "bash"              30 minutes ago      Up 30 minutes               0.0.0.0:3000->3000/tcp   dreamy_yalow

退出容器

root@5c04458cc81c:/simple-todos# exit
exit
docker@boot2docker:~$

提交容器,使用docker images

显示
docker@boot2docker:~$ docker commit -m "meteor tut start" 5c04 meteor-todos:0.2
8442afe92d2f50ac75f2a537b69472010f2bf8c101539b3598aa5ae72c65e735
docker@boot2docker:~$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
meteor-todos        0.2                 8442afe92d2f        6 seconds ago       930 MB
meteor-todos        0.1                 30bd0cd18781        4 days ago          840.6 MB

现在,如果我再次运行图像

docker@boot2docker:~$ docker run -it --rm -p 3000:3000 meteor-todos:0.2

我的简单todos目录仍在那里,所以我改变导演并运行应用程序给出命令meteor。任何人都可以告诉我这个错误吗?

root@ac7d1be3b145:/# ls
bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  simple-todos  srv  sys  tmp  usr  var
root@ac7d1be3b145:/# cd simple-todos/
root@ac7d1be3b145:/simple-todos# meteor
[[[[[ /simple-todos ]]]]]

=> Started proxy.
=> Started MongoDB.

/root/.meteor/packages/meteor-tool/.1.1.9.ltydx3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/future.js:245
                                                throw(ex);
                                                      ^
Error: EXDEV, rename '/simple-todos/.meteor/local/build'
    at Object.Future.wait (/root/.meteor/packages/meteor-tool/.1.1.9.ltydx3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/future.js:398:15)
    at /tools/fs/files.js:1331:28
    at Object.wrapper [as rename] (/tools/fs/files.js:1334:20)
    at Object.files.renameDirAlmostAtomically (/tools/fs/files.js:812:11)
    at Builder.complete (/tools/isobuild/builder.js:571:13)
    at /tools/isobuild/bundler.js:1913:13
    at /tools/isobuild/bundler.js:1930:7
    at /tools/isobuild/bundler.js:2205:22
    at /tools/utils/buildmessage.js:268:13
    at [object Object]._.extend.withValue (/tools/utils/fiber-helpers.js:114:14)
    at /tools/utils/buildmessage.js:261:29
    at [object Object]._.extend.withValue (/tools/utils/fiber-helpers.js:114:14)
    at /tools/utils/buildmessage.js:259:18
    at [object Object]._.extend.withValue (/tools/utils/fiber-helpers.js:114:14)
    at /tools/utils/buildmessage.js:250:23
    at [object Object]._.extend.withValue (/tools/utils/fiber-helpers.js:114:14)
    at Object.capture (/tools/utils/buildmessage.js:249:19)
    at Object.exports.bundle (/tools/isobuild/bundler.js:2047:31)
    at /tools/runners/run-app.js:551:36
    at time (/tools/tool-env/profile.js:232:28)
    at Function.run (/tools/tool-env/profile.js:377:12)
    at bundleApp (/tools/runners/run-app.js:541:34)
    at [object Object]._.extend._runOnce (/tools/runners/run-app.js:594:35)
    at [object Object]._.extend._fiber (/tools/runners/run-app.js:858:28)
    at /tools/runners/run-app.js:396:12
    - - - - -
root@ac7d1be3b145:/simple-todos#

注意我在windows7上使用boot2docker

EDIT1 我需要做些什么才能让它正常工作

要使其工作(在新图像中),我必须执行以下操作: 但我不想每次都删除它并重建它。我希望能够提交它并在后台运行它作为容器。

root@ac7d1be3b145:/# ls
bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  simple-todos  srv  sys  tmp  usr  var
root@ac7d1be3b145:/# rm -rf simple-todos/
root@ac7d1be3b145:/#
root@ac7d1be3b145:/#
root@ac7d1be3b145:/# meteor create simple-todos
Created a new Meteor app in 'simple-todos'.

To run your new app:
  cd simple-todos
  meteor

If you are new to Meteor, try some of the learning resources here:
  https://www.meteor.com/learn

root@ac7d1be3b145:/# cd simple-todos/
root@ac7d1be3b145:/simple-todos# meteor
[[[[[ /simple-todos ]]]]]

=> Started proxy.
=> Started MongoDB.
=> Started your app.

0 个答案:

没有答案