Git Product home page Git Product logo

meteord's Introduction

This project is no longer maintained

See jshimko/meteor-launchpad for a stable and maintained Docker base image for Meteor apps.

Circle CI

MeteorD - Docker Runtime for Meteor Apps

There are two main ways you can use Docker with Meteor apps. They are:

  1. Build a Docker image for your app
  2. Running a Meteor bundle with Docker

MeteorD supports these two ways. Let's see how to use MeteorD

1. Build a Docker image for your app

With this method, your app will be converted into a Docker image. Then you can simply run that image.

For that, you can use meteorhacks/meteord:onbuild as your base image. Magically, that's only thing you have to do. Here's how to do it:

Add following Dockerfile into the root of your app:

FROM meteorhacks/meteord:onbuild

Then you can build the docker image with:

docker build -t yourname/app .

Then you can run your meteor image with

docker run -d \
    -e ROOT_URL=http://yourapp.com \
    -e MONGO_URL=mongodb://url \
    -e MONGO_OPLOG_URL=mongodb://oplog_url \
    -p 8080:80 \
    yourname/app

Then you can access your app from the port 8080 of the host system.

Stop downloading Meteor each and every time (mostly in development)

So, with the above method, MeteorD will download and install Meteor each and every time. That's bad especially in development. So, we've a solution for that. Simply use meteorhacks/meteord:devbuild as your base image.

WARNING: Don't use meteorhacks/meteord:devbuild for your final build. If you used it, your image will carry the Meteor distribution as well. As a result of that, you'll end up with an image with ~700 MB.

2. Running a Meteor bundle with Docker

For this you can directly use the MeteorD to run your meteor bundle. MeteorD can accept your bundle either from a local mount or from the web. Let's see:

2.1 From a Local Mount

docker run -d \
    -e ROOT_URL=http://yourapp.com \
    -e MONGO_URL=mongodb://url \
    -e MONGO_OPLOG_URL=mongodb://oplog_url \
    -v /mybundle_dir:/bundle \
    -p 8080:80 \
    meteorhacks/meteord:base

With this method, MeteorD looks for the tarball version of the meteor bundle. So, you should build the meteor bundle for os.linux.x86_64 and put it inside the /bundle volume. This is how you can build a meteor bundle.

meteor build --architecture=os.linux.x86_64 ./

2.1 From the Web

You can also simply give URL of the tarball with BUNDLE_URL environment variable. Then MeteorD will fetch the bundle and run it. This is how to do it:

docker run -d \
    -e ROOT_URL=http://yourapp.com \
    -e MONGO_URL=mongodb://url \
    -e MONGO_OPLOG_URL=mongodb://oplog_url \
    -e BUNDLE_URL=http://mybundle_url_at_s3.tar.gz \
    -p 8080:80 \
    meteorhacks/meteord:base

2.2 With Docker Compose

docker-compose.yml

dashboard:
  image: yourrepo/yourapp
  ports:
   - "80:80"
  links:
   - mongo
  environment:
   - MONGO_URL=mongodb://mongo/yourapp
   - ROOT_URL=http://yourapp.com
   - MAIL_URL=smtp://some.mailserver.com:25

mongo:
  image: mongo:latest

When using Docker Compose to start a Meteor container with a Mongo container as well, we need to wait for the database to start up before we try to start the Meteor app, else the container will fail to start.

This sample docker-compose.yml file starts up a container that has used meteorhacks/meterod as its base and a mongo container. It also passes along several variables to Meteor needed to start up, specifies the port number the container will listen on, and waits 30 seconds for the mongodb container to start up before starting up the Meteor container.

Rebuilding Binary Modules

Sometimes, you need to rebuild binary npm modules. If so, expose REBUILD_NPM_MODULES environment variable. It will take couple of seconds to complete the rebuilding process.

docker run -d \
    -e ROOT_URL=http://yourapp.com \
    -e MONGO_URL=mongodb://url \
    -e MONGO_OPLOG_URL=mongodb://oplog_url \
    -e BUNDLE_URL=http://mybundle_url_at_s3.tar.gz \
    -e REBUILD_NPM_MODULES=1 \
    -p 8080:80 \
    meteorhacks/meteord:binbuild

Known Issues

Spiderable Not Working (But, have a fix)

There are some issues when running spiderable inside a Docker container. For that, check this issue: meteor/meteor#2429

Fortunately, there is a fix. Simply use ongoworks:spiderable instead the official package.

Container won't start on Joyent's Triton infrastructure

There's currently (2015-07-18) an issue relating to how the command or entry point is parsed, so containers won't boot using the 'docker run' commands as above.

Instead, Joyent support has suggested the following workaround until their fix can be rolled out.

docker run -d \
    -e ROOT_URL=http://yourapp.com \
    -e MONGO_URL=mongodb://url \
    -e MONGO_OPLOG_URL=mongodb://oplog_url \
    -p 80:80 \
    --entrypoint=bash \
    yourname/app \
    /opt/meteord/run_app.sh

meteord's People

Contributors

andrew-wharton avatar arunoda avatar borgand avatar jakobrosenberg avatar jdivy avatar jeffhmngi avatar jhgaylor avatar jshimko avatar lgandecki avatar madushan1000 avatar mhhf avatar ndarilek avatar neufeldtech avatar pauloborges avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

meteord's Issues

error: couldn't install npm packages from npm-shrinkwrap

Hey there,
I'm trying to deploy my app using dokku. However, I sometimes get this error:

=> Errors while initializing project:

While building package confinet:shippings:
error: couldn't install npm packages from npm-shrinkwrap

remote: time="2015-08-27T04:50:34-04:00" level=info msg="The command [/bin/sh -c bash $METEORD_DIR/on_build.sh] returned a non-zero code: 1"

How can I solve this problem?

Errors executing Cordova commands:

$ meteor run android
[[[[[ ~/Desktop/MeteorProjects/demo ]]]]]

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

=> App running at: http://localhost:3000/
=> Errors executing Cordova commands:

While running Cordova app for platform Android with options --emulator:
Error: Command failed:
/home/ibl/Desktop/MeteorProjects/demo/.meteor/local/cordova-build/platforms/android/cordova/run
--emulator

/home/ibl/Desktop/MeteorProjects/demo/.meteor/local/cordova-build/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command:
/home/ibl/Desktop/MeteorProjects/demo/.meteor/local/cordova-build/platforms/android/gradlew
with args:
cdvBuildDebug,-b,/home/ibl/Desktop/MeteorProjects/demo/.meteor/local/cordova-build/platforms/android/build.gradle,-PcdvBuildArch=arm,-Dorg.gradle.daemon=true
at ChildProcess.exitCallback (/tools/utils/processes.js:137:23)
at ChildProcess.emit (events.js:98:17)
at Process.ChildProcess._handle.onexit (child_process.js:820:12)

ExitWithCode:1

Tar problem deploying on Amazon ECS

I create a tar ball on my local system and uploaded it to s3. I started a container using BUNDLE_URL to point to that tar ball and the app started up fine.

Then using CodeShip, I have it build a tar ball and push it to s3. I can't get the container running pointing to the tar ball from CodeShip.

Looking at the tar balls I see some diffs.

Then command I used to create the tar was

 meteor build --architecture=os.linux.x86_64 ./

Which is the same command I entered into CodeShip. What could be the issue?

App not loading properly in IE

First - I can't say for sure this is an issue with meteord. However, if I run the app without having dockerized it with meteord, it loads up in IE just fine. When I run the dockerized version, it loads but does not run the app. So, I just get a blank page. Anyone had any similar experiences?

need option to delay startup

Would be nice to have an option to introduce a pause in the run_app.sh script. When using docker-compose with a mongo container, it takes 5-10 seconds for the mongodb to complete startup. But compose fires off the meteor container before the startup completes, causing it to fail.

I've hacked around the issue by copying in my own version of run_app.sh in the Dockerfile. I'll submit it here if you'd like it.

Error: failed to connect to [mongo-dev:27017] using docker-compose

My Dockerfile is as follows:

FROM meteorhacks/meteord:onbuild

My docker-compose.yml is as follows:

hub:
    image: ...
    restart: always
    ports: 
        - "3000:80"
    volumes:
        - ...
    links:
        - mongo-dev:mongo-dev
    environment:
        - MONGO_URL=mongodb://mongo-dev/hub
        - ROOT_URL=http://...
        - DELAY=30
        - 'METEOR_SETTINGS={ ... }'
    log_driver: "json-file"
    log_opt:
        max-size: "20m"
        max-file: "3"
mongo-dev:
    image: mongo:2.6.11
    restart: always
    ports:
        - "27017:27017"
    log_driver: "json-file"
    log_opt:
        max-size: "20m"
        max-file: "3"

It appears that the delay is not being honored, as I see the meteor container boot just as fast if not faster than the mongo container, which then fails with

hub_1       | /built_app/programs/server/node_modules/fibers/future.js:278
hub_1       |                       throw(ex);
hub_1       |                             ^
hub_1       | Error: failed to connect to [mongo-dev:27017]

...

dockerhub_hub_1 exited with code 0

I do not see https://github.com/meteorhacks/meteord/blob/master/base/scripts/run_app.sh#L36 echoed to the command line. The code appears correct, so this leads me to believe that meteord:base image has not been updated at docker.io. Can you verify?

passing in meteor run configurations

If I need to run my meteor app with a settings file (meteor run --settings settings.json) how do I build the app ensuring that when I use docker run it will also run it with that settings.json file?

error: unknown package in top-level dependencies: npm-container

Tried this out. All seemed well. Then got these errors:

Step 1 : COPY ./ /app
Step 1 : RUN bash $METEORD_DIR/on_build.sh
 ---> Running in b23aa6f46b44
Downloading Meteor distribution

Meteor 1.2.1 has been installed in your home directory (~/.meteor).
Writing a launcher script to /usr/local/bin/meteor for your convenience.

To get started fast:

  $ meteor create ~/my_cool_app
  $ cd ~/my_cool_app
  $ meteor

Or see the docs at:

  docs.meteor.com

=> Errors while initializing project:

While selecting package versions:
error: unknown package in top-level dependencies: npm-container
unknown package in top-level dependencies: bigsmall:push

These two packages are symlinked into the Meteor app.

how to stop the docker container running on specific port

Hi currently i am making a app that automatically host the apps to the server from the host app. Now the user has the ability to stop the app. Previously i was doing by killing the forever process with the specific id. How to stop the docker running on specific port. Thanks in advance

When using npm-container package build will fail

Hi,

whenever Iḿ using the package: npm-container the build will fail:

/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++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 '/app/.meteor/local/isopacks/npm-container'
    at Object.Future.wait (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/future.js:398:15)
    at Object.wrapper [as rename] (/root/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/files.js:1350:24)

Access mongo@localhost failed

My mongodb is running inside an own container (tutum/mongodb)
When I try to connect to it via localhost from meteorD connection fails

=> Starting meteor app on port:80

/bundle/bundle/programs/server/node_modules/fibers/future.js:278
                        throw(ex);
                              ^
Error: failed to connect to [localhost:27017]
    at Object.Future.wait (/bundle/bundle/programs/server/node_modules/fibers/future.js:398:15)
    at new MongoConnection (packages/mongo/mongo_driver.js:213:1)

However, when define the absolute url: mongodb://my-domain.com:27017 it works.
After researching I came across this issue. The answer was to use docker run --net="host" ...

But, when I do this, I get an other error: EADDRINUSE because of port 80, which is reserved for the proxy. So I guess it's not good to share the host network, right.

So finally best practice would be to use the global mongodb uri?

docker build error

Hey guys, I'm trying to build my app but it crashing on build. Any idea?

bash-3.2$ docker build -t gettydata/gdd .
Sending build context to Docker daemon 165.9 MB
Sending build context to Docker daemon 
Step 0 : FROM meteorhacks/meteord
# Executing 3 build triggers
Trigger 0, RUN bash /opt/meteord/install_meteor.sh
Step 0 : RUN bash /opt/meteord/install_meteor.sh
 ---> Using cache
Trigger 1, COPY ./ /app
Step 0 : COPY ./ /app
Trigger 2, RUN bash /opt/meteord/meteord-build.sh
Step 0 : RUN bash /opt/meteord/meteord-build.sh
 ---> Running in ab2949294dca

/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++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 '/app/.meteor/local/isopacks/npm-container'
    at Object.Future.wait (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/future.js:398:15)
    at Object.wrapper [as rename] (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/files.js:1350:24)
    at Object.files.renameDirAlmostAtomically (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/files.js:810:11)
    at [object Object]._.extend.complete (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/builder.js:482:11)
    at [object Object]._.extend.saveToPath (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/isopack.js:1075:15)
    at /root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/isopack-cache.js:236:21
    at /root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/buildmessage.js:352:18
    at [object Object]._.extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14)
    at /root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/buildmessage.js:345:34
    at [object Object]._.extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14)
    at /root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/buildmessage.js:343:23
    at [object Object]._.extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14)
    at Object.enterJob (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/buildmessage.js:317:26)
    at [object Object]._.extend._loadLocalPackage (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/isopack-cache.js:198:18)
    at /root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/isopack-cache.js:149:14
    at /root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/buildmessage.js:352:18
    at [object Object]._.extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14)
    at /root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/buildmessage.js:345:34
    at [object Object]._.extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14)
    at /root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/buildmessage.js:343:23
    at [object Object]._.extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14)
    at Object.enterJob (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/buildmessage.js:317:26)
    at [object Object]._.extend._ensurePackageLoaded (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/isopack-cache.js:141:20)
    at /root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/isopack-cache.js:63:14
    at /root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/package-map.js:50:7
    at Function._.each._.forEach (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:87:22)
    at [object Object]._.extend.eachPackage (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/package-map.js:42:7)
    at [object Object]._.extend.buildLocalPackages (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/isopack-cache.js:62:24)
    at /root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/project-context.js:698:25
    at /root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/buildmessage.js:352:18
    at [object Object]._.extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14)
    at /root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/buildmessage.js:345:34
    at [object Object]._.extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14)
    at /root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/buildmessage.js:343:23
    at [object Object]._.extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14)
    at Object.enterJob (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/buildmessage.js:317:26)
    at ProjectContext._.extend._buildLocalPackages (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/project-context.js:697:18)
    at /root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/project-context.js:238:35
    at /root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/buildmessage.js:352:18
    at [object Object]._.extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14)
    at /root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/buildmessage.js:345:34
    at [object Object]._.extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14)
    at /root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/buildmessage.js:343:23
    at [object Object]._.extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14)
    at Object.enterJob (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/buildmessage.js:317:26)
    at ProjectContext._.extend._completeStagesThrough (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/project-context.js:228:18)
    at ProjectContext._.extend.saveChangedMetadata (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/project-context.js:216:10)
    at ProjectContext._.extend.prepareProjectForBuild (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/project-context.js:221:10)
    at /root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/commands.js:793:20
    at /root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/buildmessage.js:264:13
    at [object Object]._.extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14)
    at /root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/buildmessage.js:257:29
    at [object Object]._.extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14)
    at /root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/buildmessage.js:255:18
    at [object Object]._.extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14)
    at /root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/buildmessage.js:246:23
    at [object Object]._.extend.withValue (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/fiber-helpers.js:115:14)
    at Object.capture (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/buildmessage.js:245:19)
    at Object.main.captureAndExit (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/main.js:271:29)
    at buildCommand (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/commands.js:792:8)
    at Command.main.registerCommand._.extend.name [as func] (/root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/commands.js:746:12)
    at /root/.meteor/packages/meteor-tool/.1.1.1.zovde3++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/main.js:1363:23
    - - - - -
/opt/meteord/meteord-build.sh: line 6: cd: /tmp/the-app/bundle/programs/server/: No such file or directory
npm ERR! install Couldn't read dependencies
npm ERR! package.json ENOENT, open '/app/package.json'
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can't find a package.json file in your current directory.

npm ERR! System Linux 3.18.5-tinycore64
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "i"
npm ERR! cwd /app
npm ERR! node -v v0.10.36
npm ERR! npm -v 1.4.28
npm ERR! path /app/package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno 34
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /app/npm-debug.log
npm ERR! not ok code 0
mv: cannot stat `/tmp/the-app/bundle': No such file or directory
 ---> db71bd0a8fd6
Removing intermediate container f9d750c412cd
Removing intermediate container ab2949294dca
Step 1 : MAINTAINER dbuarque
 ---> Running in bbd55fc546a6
 ---> d0268706f969
Removing intermediate container bbd55fc546a6
Successfully built d0268706f969

EXPOSE port 80?

I spent a good long while trying to make my fork work and ultimately I just had to add EXPOSE 80 to the dockerfile. I made a few other alterations that would exclude a direct pull request, but I can send a PR for just this one line if you'd like. Without the line I was getting connection refused from external hosts such as my browser.

Dont hard code port 80

I want to run the app on port 3000. As far as I can see the environment variable "PORT" will not be respected. I would love to be able to set

-e PORT=3000

What do you say?

Problem with --link db:mysql

Hello @arunoda,

Do you know whether it is possible to use meteord with mysql containers? I am trying to use numtel:mysql package together with mysql container, but to no avail.

First of all I start mysql container:
docker run --name db -e MYSQL_ROOT_PASSWORD=password mysql

Then I try to use meteord:
docker build -t app .
docker run -d -p 80:80 -e ROOT_URL=http://localhost -e MONGO_URL=mongodb://localhost:27017 -e MONGO_OPLOG_URL=mongodb://localhost:27017/2 --link db:mysql app

Unfortunately, when I enter http://localhost, data from mysql database are not visible. Do you know how to check any logs from meteor app run by meteord?

Thanks,
Tommy

Docker I/O and host is down

So im pretty sure this is not a bug or something else, it seems like the host for meteorhacks in docker is down, so im going to report an issue over here.

I was working with meteord normally but then for some reason i start getting this error.

An error occurred trying to connect: Post https://192.168.59.103:2376/v1.19/build?cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&memory=0&memswap=0&rm=1&t=ethaan%2Flifecadence: dial tcp 192.168.59.103:2376: host is down

And then some minutes leater this one.

An error occurred trying to connect: Post https://192.168.59.103:2376/v1.19/build?cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&memory=0&memswap=0&rm=1&t=ethaan%2Flifecadence: dial tcp 192.168.59.103:2376: i/o timeout

This happend when i run the build command.

docker build -t ethaan/lifecadence .

Docker Version

Client version: 1.7.0
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 0baf609
OS/Arch (client): darwin/amd64

Tar problem deploying an app on Deis

I tried to deploy a meteor app on a Deis cluster : http://deis.io (which simply takes the Dockerfile and produces an image before running it) but it failed due to tar errors while installing Meteor:

-----> Building Docker image
remote: Sending build context to Docker daemon 54.27 kB
Step 0 : FROM meteorhacks/meteord:devbuild
devbuild: Pulling from meteorhacks/meteord
86615df74ffa: Pulling fs layer
2ec476bbd16e: Pulling fs layer
4a0a886df271: Pulling fs layer
0feb3f2a0135: Pulling fs layer
ef3dfc2694a4: Already exists
a73c7fdae2e3: Already exists
b247a53c9076: Already exists
8889d081bf78: Already exists
d7f21f48dc95: Already exists
96826e9497d0: Already exists
4c2f3df4bb7c: Already exists
a23d622c4674: Already exists
0feb3f2a0135: Verifying Checksum
0feb3f2a0135: Download complete
2ec476bbd16e: Verifying Checksum
2ec476bbd16e: Download complete
4a0a886df271: Verifying Checksum
4a0a886df271: Download complete
86615df74ffa: Verifying Checksum
86615df74ffa: Download complete
86615df74ffa: Pull complete
2ec476bbd16e: Pull complete
4a0a886df271: Pull complete
0feb3f2a0135: Pull complete
Digest: sha256:c5be7afb55e06fa62d45799700bd069db786ec657291759d573ccb43bfdd186b
Status: Downloaded newer image for meteorhacks/meteord:devbuild
# Executing 3 build triggers
Trigger 0, RUN bash $METEORD_DIR/lib/install_meteor.sh
Step 0 : RUN bash $METEORD_DIR/lib/install_meteor.sh
 ---> Running in d337f7c2a39d
Downloading Meteor distribution
tar: .meteor/packages/coffeescript/.1.0.11.148kw9n++os+web.browser+web.cordova/plugin.compileCoffeescript.os/npm/babel-compiler/node_modules/meteor-babel/node_modules/transformers/node_modules/.bin: Directory renamed before its status could be extracted
tar: .meteor/packages/coffeescript/.1.0.11.148kw9n++os+web.browser+web.cordova/plugin.compileCoffeescript.os/npm/babel-compiler/node_modules/meteor-babel/node_modules/transformers/node_modules: Directory renamed before its status could be extracted
tar: .meteor/packages/coffeescript/.1.0.11.148kw9n++os+web.browser+web.cordova/plugin.compileCoffeescript.os/npm/babel-compiler/node_modules/meteor-babel/node_modules/transformers: Directory renamed before its status could be extracted
tar: .meteor/packages/coffeescript/.1.0.11.148kw9n++os+web.browser+web.cordova/plugin.compileCoffeescript.os/npm/babel-compiler/node_modules/meteor-babel/node_modules/defs/node_modules/.bin: Directory renamed before its status could be extracted
tar: .meteor/packages/coffeescript/.1.0.11.148kw9n++os+web.browser+web.cordova/plugin.compileCoffeescript.os/npm/babel-compiler/node_modules/meteor-babel/node_modules/defs/node_modules: Directory renamed before its status could be extracted
tar: .meteor/packages/coffeescript/.1.0.11.148kw9n++os+web.browser+web.cordova/plugin.compileCoffeescript.os/npm/babel-compiler/node_modules/meteor-babel/node_modules/defs: Directory renamed before its status could be extracted
tar: .meteor/packages/coffeescript/.1.0.11.148kw9n++os+web.browser+web.cordova/plugin.compileCoffeescript.os/npm/babel-compiler/node_modules/meteor-babel/node_modules/.bin: Directory renamed before its status could be extracted
tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm/node_modules/meteor-babel/node_modules/with/node_modules/.bin: Directory renamed before its status could be extracted
tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm/node_modules/meteor-babel/node_modules/with/node_modules: Directory renamed before its status could be extracted
tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm/node_modules/meteor-babel/node_modules/with: Directory renamed before its status could be extracted
tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm/node_modules/meteor-babel/node_modules/transformers/node_modules/.bin: Directory renamed before its status could be extracted
tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm/node_modules/meteor-babel/node_modules/transformers/node_modules: Directory renamed before its status could be extracted
tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm/node_modules/meteor-babel/node_modules/transformers: Directory renamed before its status could be extracted
tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm/node_modules/meteor-babel/node_modules/defs/node_modules/.bin: Directory renamed before its status could be extracted
tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm/node_modules/meteor-babel/node_modules/defs/node_modules: Directory renamed before its status could be extracted
tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm/node_modules/meteor-babel/node_modules/defs: Directory renamed before its status could be extracted
tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm/node_modules/meteor-babel/node_modules/.bin: Directory renamed before its status could be extracted
tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm/node_modules/meteor-babel/node_modules: Directory renamed before its status could be extracted
tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm/node_modules/meteor-babel: Directory renamed before its status could be extracted
tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm/node_modules: Directory renamed before its status could be extracted
tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm: Directory renamed before its status could be extracted
tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova: Directory renamed before its status could be extracted
tar: .meteor/packages/babel-compiler: Directory renamed before its status could be extracted
tar: Exiting with failure status due to previous errors
Installation failed.
The command '/bin/sh -c bash $METEORD_DIR/lib/install_meteor.sh' returned a non-zero code: 2

The error Directory renamed before its status could be extracted seems to be linked to a permission fault but I didn't found any way to fix this. Onbuild or devbuild don't change anything

PS: The error is not occurring while building the image locally with either onbuild or devbuild.

Thank you in advance for your support

Why not have github pull?

There are some other docker images on dockerhub that attempt to use github to pull the latest code on the first build.
Is there a reason you are not doing that here? It would be ideal for continuous deployment to have a github webhook trigger a build.
Not sure what the best practice is for a meteor cluster running on docker. But it seems like there should be a way to do continuous deployment.

Why is using devbuild bad?

I don't really see the drawback of the devbuild for production. I build images and push them to a private docker repository. The larger the "base image" for my image, the less I have to push on a code change. Please elaborate a little on why onbuild is still better.

How to use with jwilder/nginx-proxy

Hi guys,

sorry for the maybe simple question, but how to make the meteorD image work with jwilder/nginx-proxy if I am already using it in my setup..

Is anyone familiar with it?

Just ideas and feedback

  1. Is Ubuntu as baseimage really necessary?
    the official Docker NodeJS images seems to be build around Debian, which have a smaller footprint
  2. The official way to install meteor doesn't allow to specify directly the release you want
    but is possible to live patch that script.
  3. Meteor already embeds NodeJS
    It seems a good idea to use that, at least if you already have meteor in that image to run meteor build.
    Also because it isn't guareanteed meteor would work with latest NodeJs or IOjs release

What is the point of devbuild?

Maybe I'm missing something obvious?

I wanted to launch my Meteor stack from docker-compose rather than the command line tool. I.e. docker-compose would use the meteor command directly, but it would link to a separate mongo plus other services I need for my app. My code directory would be bind-mounted into /app, and docker-compose would basically replace the locally-run meteor command, giving me the ability to spin up and monitor something like postgres instead of mongo.

I'd have expected devbuild to accomplish this, only it removes the local meteor install on its way out. I can certainly reinstall it myself, but what is the point of devbuild if it does this? I get that it behaves a bit differently, but under what scenarios would I want to use devbuild vs. onbuild? I.e. not "it downloads Meteor every time," but what practical benefit does this distinction serve as implemented? My expectation is that devbuild leaves the local install in place so I can use it for development in cases where I need to spin up dependent services and want to do so as part of a single-command launch.

Thanks.

New to docker

I'm stuck on step 2, it just says create my app, or visit docs.meteor.com then crashes afterwards. Am I missing something?

Support for HTTPS

Is it possible to provide a meteor app also via HTTPS? So far I can see only that the HTTP port 80 gets exported. Would really appreciate if that's possible as HTTP is really a security issue.

Error 400 while pulling code

While bulding my Dockerfile containing

FROM meteorhacks/meteord:onbuild

I get the following error:

Building web
Step 0 : FROM meteorhacks/meteord:onbuild
Pulling repository docker.io/meteorhacks/meteord
469b6dde8872: Error pulling image (onbuild) from docker.io/meteorhacks/meteord, HTTP code 400
/v1/, HTTP code 400oad complete
19de96c112fc: Download complete
56e449d8c427: Download complete
36d94ecebf63: Error pulling dependent layers
ERROR: Service 'web' failed to build: Error pulling image (onbuild) from docker.io/meteorhacks/meteord, HTTP code 400

This happened several times, even with VPN (in case there would have been a problem related to a CDN) the same build was working fine before… any idea or similar issue encountered ?

installing meteor every time

What is the reason of installing meteor everytime from a bash script, instead of including it inside the Dockerfile (so it only installs once on the Docker base image)?

Recommended way for running other services on the same container

I would need to know if there is a specific recommendation for running a deamon (sshd in my case) using the meteord images. I.e. to start a process aside of nodejs.

For people dodging the question, I do know it is not the best docker's practice and I am not trying to use SSH for inspecting the container. For now I run 2 containers (one server and one sshd) but it would be more simple for my client to run only one container instead (and here also I know I can make use of docker-compose).

Compatible with spiderable?

Thank you for this great work. Just noticed that when I access to my website with ?_escaped_fragment_=, I have an error 500: "Internal Server Error".

Logs say:

Error: spawn ENOMEM
    at errnoException (child_process.js:1011:11)
    at ChildProcess.spawn (child_process.js:958:11)
    at exports.spawn (child_process.js:746:9)
    at Object.exports.execFile (child_process.js:628:15)
    at Object.Package [as handle] (packages/spiderable/spiderable_server.js:105:1)
    at next (/bundle/bundle/programs/server/npm/webapp/node_modules/connect/lib/proto.js:190:15)
    at middleware (packages/oauth/oauth_server.js:157:1)
    at packages/oauth/oauth_server.js:146:1

So the website cannot be indexed by Google, nor used with Adwords.

BUNDLE_URL authentication

As far as I can tell, BUNDLE_URL needs to be open to the public. Would be nice if BUNDLE_URL could be configured with (AWS) authentication credentials. Perhaps using s3curl.

slim down production build

This is an optimization ticket.

I tested out a few meteor docker images, and like the heavy use of this image and the simplicity. However, when comparing it to https://github.com/chriswessels/meteor-tupperware the production build sizes were quite a bit different:
tupperware: 322.1 MB
meteord: 439 MB

It looks like tupperware is doing some sort of cleanup https://github.com/chriswessels/meteor-tupperware/blob/master/includes/scripts/_post_clean.sh

Wanted to hear pros/cons of implementing something like this into meteord.

Setting MONGO_URL via linking

Currently MONGO_URL is set as environment variable. This is useful when MongoDB url is fixed (e.g. an external cloud service). However, if another container is used for MongoDB, then the url can change after restarting (right?) and it could be hard to fetch the correct IP address automatically. In this case I think Docker linking is the best option. I tried to override without success the default entrypoint of your script and setting the environment var through linking before calling "run" script. Hence I think the original Dockerfile should be changed in order to handle the two cases. Since I am new to Docker, I wonder if you have already in mind a strategy or if there is a workaround for the current implementation. Thanks.

npm dependencies in local packages not getting installed on build

I'm a little stuck on this one. I've tried everything I can think of to get my npm dependencies to be included in the build, but it never happens and no errors are thrown. To be clear, I'm talking about local packages in the /packages folder of my app with npm dependencies being declared in their package.js like this:

Npm.depends({
  'name': '1.2.3'
});

I've also tried adding the same dependency globally in the app using meteorhacks:npm, but I get the same result. Nothing in the build output implies that the module install is even being attempted. Are there extra steps for this that I'm not seeing? I've definitely built apps using MeteorD that had npm dependencies in local packages and I didn't run into this (Telescope is a perfect example). Is it possibly something with the npm package I'm trying to install? (It's the ws package I need for a websocket API I'm using in my app)

Any suggestions would be greatly appreciated.

How to get working with custom meteor build, pls?

Hi, thanks again for this, wondering if you have any guidelines on how I could use a customer Meteor build, please?

I did have a quick look around some of the scripts like https://github.com/meteorhacks/meteord/blob/master/binbuild/scripts/install_binbuild_tools.sh but thought I'd ask, before trying to reverse engineer.

Basically I am trying to use @Igor1201 approach here: https://forums.meteor.com/t/how-to-get-crosswalk-working-with-android-step-by-step-guide/6683 an this use this modified Meteor to run on Docker.

@ArjunRajJain not sure if you've tried this yet?

automatically build linux?

Is there a way to add-platform linux so that I don't have to type this in: meteor build --architecture=os.linux.x86_64 ./ and can just do meteor build --server=example.com? I understand (I think) that if I build it from within a linux distro it will do this automatically, but it seems like there should be a way to have it automatically build for linux.

Project with mobile frameworks fails with this error

=> Errors executing Cordova commands:

While building Cordova app for platform Android:
Error:
/copied-app/.meteor/local/cordova-build/platforms/android/cordova/build:
Command failed with exit code 2 Error output:
[Error: Failed to find 'ANDROID_HOME' environment variable. Try setting
setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to
include path to valid SDK directory.]
at ChildProcess.whenDone
(/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/cordova-lib/src/cordova/superspawn.js:139:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:766:16)
at Process.ChildProcess._handle.onexit (child_process.js:833:5)

Using option "2.1 From the Web" - getting error "/opt/meteord/run_app.sh: line 17: cd: /built_app: No such file or directory"

Hi,

I am pretty new to Docker.

I am trying option 2.1 from https://github.com/meteorhacks/meteord which fails as I don't have GraphicsMagick installed .

I am assuming I need to connect into the image and then add GrahicsMagick (eg sudo apt-get install graphicsmagick) and then commit the change. Is this correct?

When i try and connect using docker run -i -t meteorhacks/meteord:latest /bin/bash I get the following error: /opt/meteord/run_app.sh: line 17: cd: /built_app: No such file or directory any help or better ways to this welcome.

Error: failed to connect to [localhost:3001]

Hi,

Thanks for this project :) I am very interested to dockerize my project, to simplify it's distribution.

I was able to create the image but when I try to run it with this command

docker run -d \
-e ROOT_URL=http://localhost:3000 \
-e MONGO_URL=mongodb://localhost:3001/meteor \
-e METEOR_SETTINGS='{ALL_MY_SETTINGS}' \
-p 3000:80 \
picsoung/apisio

but in the logs of the container I have Error: failed to connect to [localhost:3001]
I am just trying to run on the default port.

What goes wrong?
Thanks for your help :)

Add cordova support

In order to build a cordova app, we may need to add ios or android platform.
Meteor Up already has a trick to do without installing above platforms. Let's use this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.