Giter VIP home page Giter VIP logo

meteor-tupperware's Introduction

chriswessels/meteor-tupperware

Notice: This package is no longer maintained. I recommend using the following alternative: https://github.com/jshimko/meteor-launchpad

This is a base Docker image that allows you to bundle your Meteor.js application into a lean, production-ready Docker image that you can deploy across your containerised infrastructure.

Docker Repository on Quay.io

It includes Node.js and your bundled application (with platform-correct native extensions where required by included npm modules). You can also configure meteor-tupperware to install PhantomJS and ImageMagick if these are dependencies of your application.

Please see the CHANGELOG for the latest bundled library versions and changes.

Usage

Quickstart

In your Meteor.js project directory, run the following command:

curl https://raw.githubusercontent.com/chriswessels/meteor-tupperware/master/quickstart.sh > /tmp/quickstart.sh && bash /tmp/quickstart.sh

This script will write a Dockerfile and .dockerignore into your current directory, preconfigured as in Manual Setup below.

After running the quickstart script, and assuming you have Docker running, you can build an image of your Meteor.js app by running:

docker build -t yourname/app .

Manual setup (skip if you used Quickstart)

Using meteor-tupperware is very simple. Create a Dockerfile in your Meteor project directory with the following contents:

FROM    quay.io/chriswessels/meteor-tupperware

This base image contains build triggers that will run when you build your app image. These triggers will build your app, install any dependencies, and leave you with a lean, production-ready image.

You'll also need to create a .dockerignore file in your Meteor project directory (alongside the Dockerfile) with the following contents:

.meteor/local
packages/*/.build*
packages/*/.npm*

This file instructs Docker not to copy build artifacts into the image as these will be rebuilt anyway.

Assuming you have Docker running, you can build an image of your Meteor.js app by running:

docker build -t yourname/app .

Running your app image

The root process of the image will be set to the Node.js entrypoint for your Meteor application, so you can pass runtime settings straight into docker run -e, or bake them into your image with ENV directives in your Dockerfile.

Node.js will listen on port 80 inside the container, but you can bind this to any port on the host. You can also specify a different internal port if you need to like this:

FROM    quay.io/chriswessels/meteor-tupperware
ENV     PORT=8080

Example of passing options into docker run at runtime:

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

This example will run your Meteor application configured to connect to Mongo at mongodb://url, the Mongo oplog at mongodb://oplog_url, and will listen on port 8080 on the host, with Meteor expecting the public address of your app to be http://yourapp.com.

Example of baking options into your image using your Dockerfile so you don't have to pass them in at runtime:

FROM    quay.io/chriswessels/meteor-tupperware
ENV     MONGO_URL="mongodb://url" MONGO_OPLOG_URL="mongodb://oplog_url" ROOT_URL="http://yourapp.com"

Build configuration

meteor-tupperware supports a few build configuration options that can be modified by creating a tupperware.json file in your Meteor project directory, alongside your Dockerfile. After changing tupperware.json you will need to rebuild your image with docker build (as above).

Default configuration options:

/* tupperware.json */
{
  "dependencies": {
    "phantomJs": false,
    "imageMagick": false
  },
  "preBuildCommands": [],
  "postBuildCommands": [],
  "buildOptions": {
    "mobileServerUrl": false,
    "additionalFlags": false
  }
}

tupperware.json Schema

  • dependencies
    • phantomJs: true or false (for installing PhantomJS)
    • imageMagick: true or false (for installing ImageMagick)
  • preBuildCommands [string] (an array of commands to run before meteor build. Paths are relative to your app directory)
  • postBuildCommands [string] (an array of commands to run after meteor build. Paths are relative to your app directory)
  • buildOptions
    • mobileServerUrl: false or type string (for specifying a server URL if you have mobile clients via Cordova)
    • additionalFlags: false or type string (for passing additional command line flags to meteor build)

Pre and post build commands

As above, you can use the preBuildCommands option in tupperware.json to specify a list of commands that should be run prior to meteor build. You can use postBuildCommands to specify a list of commands that should be run after. The commands are executed within your app directory (/app with the container image).

This can be useful for installing private smart packages for your Meteor app prior to building, or performing post build transformations/cleanup.

Contributions

Contributions are welcomed and appreciated!

  1. Fork this repository.
  2. Make your changes, documenting your new code with comments.
  3. Submit a pull request with a sane commit message.

Feel free to get in touch if you have any questions.

License

Please see the LICENSE file for more information.

meteor-tupperware's People

Contributors

aldeed avatar area avatar chriswessels avatar ianmartorell avatar ijpiantanida 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

meteor-tupperware's Issues

Better Demo

Hi, love that you put this together, thank you! However I'm having some trouble using it. I've created a new meteor app, cd into the folder for my app, and ran your Quickstart command. But I don't see anything in my browser. From what I can see, I should be able to see something.

It's also unclear to me if I can run the mongo DB in the same container for development purposes, I think not, it looks like this is aimed more at production/staging only. So a note about this in the README could be useful to others.

future.js module throwing exception

I've encountered the following error message after building a new image of my test meteor app.

root@docker-staging:~/simple-todos# docker run -e MONGO_URL=mongodb://admin:[email protected]:xxxx/ smi/tupperwaretest
[-] meteor-tupperware is starting your application with NODE_ENV=production and METEOR_ENV=production...

/output/bundle/programs/server/node_modules/fibers/future.js:278
                        throw(ex);
                              ^
[object Object]
    at Object.Future.wait (/output/bundle/programs/server/node_modules/fibers/future.js:398:15)
    at new MongoConnection (packages/mongo/mongo_driver.js:213:1)
    at new MongoInternals.RemoteCollectionDriver (packages/mongo/remote_collection_driver.js:4:1)
    at Object.<anonymous> (packages/mongo/remote_collection_driver.js:38:1)
    at Object.defaultRemoteCollectionDriver (packages/underscore/underscore.js:750:1)
    at new Mongo.Collection (packages/mongo/collection.js:102:1)
    at simple-todos.js:12:9
    at /output/bundle/programs/server/app/simple-todos.js:28:4
    at /output/bundle/programs/server/boot.js:242:10
    at Array.forEach (native)

My research points to version 0.10.41 of node being the culprit but I'm a bit lost with anything past that, including the most efficient way to confirm it. I created the image with the process outlined in the root readme.md (ran the shell script, which worked in the end but also threw the error on line 19).

root@docker-staging:~/simple-todos# curl https://raw.githubusercontent.com/chriswessels/meteor-tupperware/master/quickstart.sh > /tmp/quickstart.sh && sh /tmp/quickstart.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1565  100  1565    0     0   5561      0 --:--:-- --:--:-- --:--:--  5589

>> meteor-tupperware quickstart script 0.1.2

/tmp/quickstart.sh: 11: /tmp/quickstart.sh: [[: not found
/tmp/quickstart.sh: 11: /tmp/quickstart.sh: -f: not found
] Docker Image Maintainer Information
? Please enter your name: 
mlschuh
/tmp/quickstart.sh: 19: /tmp/quickstart.sh: [[: not found

] Success

Any tips on where to start digging?

-Mitch

Can't find `tupperware.jSON`

I have file in folder... but not picked up

-] github.com/chriswessels/meteor-tupperware (tupperbuild v1.0.0)

[-] No tupperware.json found, using defaults.
[-] Downloading Meteor 1.5.2 Installer...
[-] Installing Meteor 1.5.2...
[-] Building your app...
[!] While attempting to build your application, the command: meteor build --allow-superuser --directory /output --architecture os.linux.x86_64
[!] Failed with the exit code 1. The signal was null.
[-] The task produced the following stdout:

file here:
/* tupperware.json */
{
"dependencies": {
"phantomJs": false,
"imageMagick": false
},
"preBuildCommands": [],
"postBuildCommands": [],
"buildOptions": {
"mobileServerUrl": "https://XYZ123.ngrok.io",
"additionalFlags": "--settings settings.json --server-only --server=https://XYZ123.ngrok.io"
}
}

Container build failure..

I'm getting the following error when trying to build my docker image:

[!]  While attempting to install Meteor.js, the command: sh /tmp/install_meteor.sh
[!]  Failed with the exit code 2. The signal was undefined.
[-]  The task produced the following stderr:
Downloading Meteor distribution
tar: .meteor/packages/ecmascript/.0.8.0.y01uxl++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/modules/node_modules/.bin: Directory renamed before its status could be extracted
tar: .meteor/packages/ecmascript/.0.8.0.y01uxl++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/modules/node_modules: Directory renamed before its status could be extracted
tar: .meteor/packages/ecmascript/.0.8.0.y01uxl++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/modules: Directory renamed before its status could be extracted
tar: .meteor/packages/ecmascript/.0.8.0.y01uxl++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/regjsparser/node_modules/.bin: Directory renamed before its status could be extracted
tar: .meteor/packages/ecmascript/.0.8.0.y01uxl++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/regjsparser/node_modules: Directory renamed before its status could be extracted
tar: .meteor/packages/ecmascript/.0.8.0.y01uxl++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/regjsparser: Directory renamed before its status could be extracted
tar: .meteor/packages/ecmascript/.0.8.0.y01uxl++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-constant-folding/node_modules/.bin: Directory renamed before its status could be extracted
tar: .meteor/packages/ecmascript/.0.8.0.y01uxl++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-constant-folding/node_modules: Directory renamed before its status could be extracted
tar: .meteor/packages/ecmascript/.0.8.0.y01uxl++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-constant-folding: Directory renamed before its status could be extracted
tar: .meteor/packages/ecmascript/.0.8.0.y01uxl++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules/.bin: Directory renamed before its status could be extracted
tar: .meteor/packages/ecmascript/.0.8.0.y01uxl++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler/node_modules: Directory renamed before its status could be extracted
tar: .meteor/packages/ecmascript/.0.8.0.y01uxl++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor/babel-compiler: Directory renamed before its status could be extracted
tar: .meteor/packages/ecmascript/.0.8.0.y01uxl++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules/meteor: Directory renamed before its status could be extracted
tar: .meteor/packages/ecmascript/.0.8.0.y01uxl++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm/node_modules: Directory renamed before its status could be extracted
tar: .meteor/packages/ecmascript/.0.8.0.y01uxl++os+web.browser+web.cordova/plugin.compile-ecmascript.os/npm: Directory renamed before its status could be extracted
tar: .meteor/packages/ecmascript/.0.8.0.y01uxl++os+web.browser+web.cordova/plugin.compile-ecmascript.os: Directory renamed before its status could be extracted
tar: .meteor/packages/ecmascript/.0.8.0.y01uxl++os+web.browser+web.cordova: Directory renamed before its status could be extracted
tar: .meteor/packages/ecmascript: Directory renamed before its status could be extracted
tar: .meteor/packages/babel-compiler/.6.19.1.igixoi++os+web.browser+web.cordova/npm/node_modules/regjsparser/node_modules/.bin: Directory renamed before its status could be extracted
tar: .meteor/packages/babel-compiler/.6.19.1.igixoi++os+web.browser+web.cordova/npm/node_modules/regjsparser/node_modules: Directory renamed before its status could be extracted
tar: .meteor/packages/babel-compiler/.6.19.1.igixoi++os+web.browser+web.cordova/npm/node_modules/regjsparser: Directory renamed before its status could be extracted
tar: .meteor/packages/babel-compiler/.6.19.1.igixoi++os+web.browser+web.cordova/npm/node_modules/babel-plugin-minify-constant-folding/node_modules/.bin: Directory renamed before its status could be extracted
tar: .meteor/packages/babel-compiler/.6.19.1.igixoi++os+web.browser+web.cordova/npm/node_modules/babel-plugin-minify-constant-folding/node_modules: Directory renamed before its status could be extracted
tar: .meteor/packages/babel-compiler/.6.19.1.igixoi++os+web.browser+web.cordova/npm/node_modules/babel-plugin-minify-constant-folding: Directory renamed before its status could be extracted
tar: .meteor/packages/babel-compiler/.6.19.1.igixoi++os+web.browser+web.cordova/npm/node_modules/.bin: Directory renamed before its status could be extracted
tar: .meteor/packages/babel-compiler/.6.19.1.igixoi++os+web.browser+web.cordova/npm/node_modules: Directory renamed before its status could be extracted
tar: .meteor/packages/babel-compiler/.6.19.1.igixoi++os+web.browser+web.cordova/npm: Directory renamed before its status could be extracted
tar: .meteor/packages/babel-compiler/.6.19.1.igixoi++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

[-]  Container build failed. meteor-tupperware is exiting...
The command '/bin/sh -c sh /tupperware/scripts/on_build.sh' returned a non-zero code: 1

Docker Hub automated builds error 'Directory renamed before its status could be extracted'

@chriswessels I'm really interested in this package. However while testing with DockerHub I get the following error, on automated builds:

[-]  No tupperware.json found, using defaults. 
[-]  Downloading Meteor 1.3.2.4 Installer... 
[-]  Installing Meteor 1.3.2.4... 
[!]  While attempting to install Meteor.js, the command: sh /tmp/install_meteor.sh 
[!]  Failed with the exit code 2. The signal was undefined. 
[-]  The task produced the following stderr:

In different places I see 'Directory renamed before its status could be extracted' . Any clues how this can be fixed? Thanks!

Builder can not write without either data or a file path or a symlink path: os/packages/packages.json

hi, thanks for the package... I am getting the following error when running the quickstart....

Any ideas pls?
BTW< I need a Meteor settings file... so expect I need to do as an ENV var in the dockerfile?

# Executing 2 build triggers...
Step 1/1 : COPY ./ /app
Step 1/1 : RUN sh /tupperware/scripts/on_build.sh
 ---> Running in c2418683b864

  _                                                      
 | |_ _   _ _ __  _ __   ___ _ ____      ____ _ _ __ ___ 
 | __| | | | '_ \| '_ \ / _ \ '__\ \ /\ / / _` | '__/ _ \
 | |_| |_| | |_) | |_) |  __/ |   \ V  V / (_| | | |  __/
  \__|\__,_| .__/| .__/ \___|_|    \_/\_/ \__,_|_|  \___|
           |_|   |_|                                     

[-]  github.com/chriswessels/meteor-tupperware (tupperbuild v1.0.0)

[-]  No tupperware.json found, using defaults.
[-]  Downloading Meteor 1.5.2 Installer...
[-]  Installing Meteor 1.5.2...
[-]  Building your app...
[!]  While attempting to build your application, the command: meteor build --allow-superuser --directory /output --architecture os.linux.x86_64 
[!]  Failed with the exit code 1. The signal was null.
[-]  The task produced the following stdout:

Even with METEOR_ALLOW_SUPERUSER or --allow-superuser, permissions in your app
directory will be incorrect if you ever attempt to perform any Meteor tasks as
a normal user. If you need to fix your permissions, run the following command
from the root of your project:

  sudo chown -Rh <username> .meteor/local

buzzy-buzz:resources-core: updating npm dependencies -- aws-sdk,
s3-write-stream, webshot, vimeo-api, html-truncate...

[-]  The task produced the following stderr:
/root/.meteor/packages/templating-compiler/.1.3.2.1fkuaqr++os+web.browser+web.cordova/plugin.compileTemplatesBatch.os/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:190
      throw error;
      ^

Error: Builder can not write without either data or a file path or a symlink path: os/packages/packages.json
  at Builder.write (/root/.meteor/packages/meteor-tool/.1.5.2.ecibw9++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/isobuild/builder.js:322:13)
  at Builder.writeToGeneratedFilename (/root/.meteor/packages/meteor-tool/.1.5.2.ecibw9++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/isobuild/builder.js:466:10)
  at /root/.meteor/packages/meteor-tool/.1.5.2.ecibw9++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/isobuild/isopack.js:1357:43

Maybe update to Node 4.8.2 or determine Node version from Meteor version?

I got errors sending emails with Meteor email pkg when deploying an app that I just updated. It complains about use of Buffer.from in node4mailer. This is because it got auto-updated to 1.2.1 of email pkg (see meteor/meteor#8609). I don't think that should have been a patch version bump of the email pkg, but too late now. But I believe using newer Node will fix because I don't see the issue with meteor run, so maybe a good fix would be to rebuild the tupperware image using Node 4.8.2?

FYI @edemaine

(The way I've fixed for now is by pinning email@=1.2.0)

Errors out with Meteor 1.3

See below:

# Executing 2 build triggers...
Step 1 : COPY ./ /app
Step 1 : RUN sh /tupperware/scripts/on_build.sh
 ---> Running in 7ff470842faf

  _                                                      
 | |_ _   _ _ __  _ __   ___ _ ____      ____ _ _ __ ___ 
 | __| | | | '_ \| '_ \ / _ \ '__\ \ /\ / / _` | '__/ _ \
 | |_| |_| | |_) | |_) |  __/ |   \ V  V / (_| | | |  __/
  \__|\__,_| .__/| .__/ \___|_|    \_/\_/ \__,_|_|  \___|
           |_|   |_|                                     

[-]  github.com/chriswessels/meteor-tupperware (tupperbuild v1.0.0)

[-]  No tupperware.json found, using defaults.
[-]  Downloading Meteor 1.3-modules-beta.5 Installer...
[-]  Installing Meteor 1.3-modules-beta.5...
[!]  While attempting to install Meteor.js, the command: sh /tmp/install_meteor.sh
[!]  Failed with the exit code 2. The signal was undefined.
[-]  The task produced the following stderr:
Downloading Meteor distribution

curl: (22) The requested URL returned error: 404 Not Found

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
Installation failed.

[-]  Container build failed. meteor-tupperware is exiting...
The command '/bin/sh -c sh /tupperware/scripts/on_build.sh' returned a non-zero code: 1

Tupperware just hangs after [-] Building your app...

[-]  github.com/chriswessels/meteor-tupperware (tupperbuild v1.0.0)

[-]  Settings in tupperware.json registered.
[-]  Downloading Meteor 1.4.1.1 Installer...
[-]  Installing Meteor 1.4.1.1...
[-]  Building your app...

Projects builds and works locally and when deployed to VPS. Cannot for the life of me figure out why it ends here and goes no further. No error message just hangs.

Any help is appreciated!

How to set ROOT_URL, MONGO_URL MONGO_OPLOG_URL and build error

ENV MONGO_URL="mongodb://url" MONGO_OPLOG_URL="mongodb://oplog_url" ROOT_URL="http://yourapp.com"

How to get/set the ROOT_URL, MONGO_URL, MONGO_OPLOG_URL

tupperware.json:

{
"dependencies": {
"phantomJs": false,
"imageMagick": false
},
"preBuildCommands": ["sudo apt-get update && sudo apt-get install -y --force=yes build-essential python"],
"postBuildCommands": [],
"buildOptions": {
"mobileServerUrl": false,
"additionalFlags": false
}
}

$ docker build -t scheung/spark2acs .
Sending build context to Docker daemon 356.9 MB
Step 1 : FROM quay.io/chriswessels/meteor-tupperware

Executing 2 build triggers...

Step 1 : COPY ./ /app
Step 1 : RUN sh /tupperware/scripts/on_build.sh
---> Running in cc53a398420d

_
| |_ _ _ _ __ _ __ ___ _ ____ ____ _ _ __ ___
| | | | | '_ | '_ \ / _ \ '\ \ /\ / / ` | '__/ _
| |
| || | |) | |) | **/ | \ V V / (| | | | /
**|
,| ./| ./ **|| _// **,|| _|
|
| |
|

[-] github.com/chriswessels/meteor-tupperware (tupperbuild v1.0.0)

[-] Settings in tupperware.json registered.
[-] Downloading Meteor 1.3.2.4 Installer...
[-] Installing Meteor 1.3.2.4...
[-] Running pre-build commands...
[!] While attempting to run pre-build command, the command: sudo apt-get update && sudo apt-get install -y --force=yes build-essential python
[!] Failed with the exit code 100. The signal was null.
[-] The task produced the following stdout:
Get:1 http://security.debian.org jessie/updates InRelease [63.1 kB]
Ign http://httpredir.debian.org jessie InRelease
Get:2 http://httpredir.debian.org jessie-updates InRelease [142 kB]
Get:3 http://security.debian.org jessie/updates/main amd64 Packages [387 kB]
Get:4 http://httpredir.debian.org jessie Release.gpg [2373 B]
Get:5 http://httpredir.debian.org jessie Release [148 kB]
Get:6 http://httpredir.debian.org jessie-updates/main amd64 Packages [17.6 kB]
Get:7 http://httpredir.debian.org jessie/main amd64 Packages [9032 kB]
Fetched 9792 kB in 16s (586 kB/s)
Reading package lists...

[-] The task produced the following stderr:
E: Command line option --force=yes is not understood

TypeError : cannot read property '1' of null

Hi,

I have the following issue while creating a docker image of a meteor project :

Sending build context to Docker daemon 42.33 MB
Step 1 : FROM quay.io/chriswessels/meteor-tupperware

Executing 2 build triggers...

Step 1 : COPY ./ /app
---> Using cache
Step 1 : RUN sh /tupperware/scripts/on_build.sh
---> Running in 41c3c7a311a8

[-] github.com/chriswessels/meteor-tupperware (tupperbuild v1.0.0)

[-] No tupperware.json found, using defaults.
/tupperware/tupperbuild/main.js:238
meteorVersion = matches[1];
^

TypeError: Cannot read property '1' of null
at downloadMeteorInstaller (/tupperware/tupperbuild/main.js:238:26)
at /tupperware/tupperbuild/node_modules/async/lib/async.js:607:21
at /tupperware/tupperbuild/node_modules/async/lib/async.js:246:17
at iterate (/tupperware/tupperbuild/node_modules/async/lib/async.js:146:13)
at /tupperware/tupperbuild/node_modules/async/lib/async.js:157:25
at /tupperware/tupperbuild/node_modules/async/lib/async.js:248:21
at /tupperware/tupperbuild/node_modules/async/lib/async.js:612:34
at /tupperware/tupperbuild/main.js:227:5
at /tupperware/tupperbuild/node_modules/async/lib/async.js:607:21
at /tupperware/tupperbuild/node_modules/async/lib/async.js:246:17
The command '/bin/sh -c sh /tupperware/scripts/on_build.sh' returned a non-zero code: 1

Can anyone give me some help or tips ?
Thanks a lot !

How to launch after built?

---> Running in b8d6992bdb95
 ---> 4657489eb80b
Removing intermediate container b8d6992bdb95
Successfully built 4657489eb80b

I dont see the image anywhere in the Docker Kitematic GUI after refresh?

SMB Hash with Bcrypt

Hi I'm using tupperware and I'm hashing data with Meteor.npmRequire('smbhash').nthash; When I run the container I get the below message. Has anyone run into this? I've solved it in the past removing bcrypt and using "npm install bcrypt" to reinstall but I'd rather not install npm in this optimized image.

Exception while invoking method 'hashit' Error: Can't find npm module 'smbhash'. Did you forget to call 'Npm.depends' in package.js within the 'npm-container' package?

Thanks for any help.

Update comparision

Hi,

After the rise of this package, I've make some improvements to MeteorD and I think may be update the README.

  1. Now MeteorD is ~220MB (Since it includes PhantomJS by default)
  2. Resulting meteor app image only take additional space for the bundle and node modules (For an example, telescope is ~270MB)
  3. We've added built in support for the --server flag and having any URL is enough.

Docker build can't install 'fibers' because 'python' is missing

My Dockerfile only contains FROM quay.io/chriswessels/meteor-tupperware and I have no tupperware.json. My OS is Windows. This is what I get:

Sending build context to Docker daemon 23.61 MB
Step 1 : FROM quay.io/chriswessels/meteor-tupperware
# Executing 2 build triggers...
Step 1 : COPY ./ /app
Step 1 : RUN sh /tupperware/scripts/on_build.sh
 ---> Running in f0cca5ec3575

  _
 | |_ _   _ _ __  _ __   ___ _ ____      ____ _ _ __ ___
 | __| | | | '_ \| '_ \ / _ \ '__\ \ /\ / / _` | '__/ _ \
 | |_| |_| | |_) | |_) |  __/ |   \ V  V / (_| | | |  __/
  \__|\__,_| .__/| .__/ \___|_|    \_/\_/ \__,_|_|  \___|
           |_|   |_|

[-]  github.com/chriswessels/meteor-tupperware (tupperbuild v1.0.0)

[-]  No tupperware.json found, using defaults.
[-]  Downloading Meteor 1.3 Installer...
[-]  Installing Meteor 1.3...
[-]  Building your app...
[-]  Installing npm dependencies for your app...
[!]  While attempting to install your application's npm dependencies, the command: npm install
[!]  Failed with the exit code 1. The signal was null.
[-]  The task produced the following stdout:

> [email protected] install /output/bundle/programs/server/node_modules/fibers
> node build.js || nodejs build.js


[-]  The task produced the following stderr:
npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at failNoPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:103:14)
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:42:11
gyp ERR! stack     at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:43:25)
gyp ERR! stack     at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:46:29)
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/which.js:57:16
gyp ERR! stack     at Object.oncomplete (evalmachine.<anonymous>:108:15)
gyp ERR! System Linux 4.1.13-boot2docker
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /output/bundle/programs/server/node_modules/fibers
gyp ERR! node -v v0.10.40
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
Build failed
sh: 1: nodejs: not found

npm ERR! [email protected] install: `node build.js || nodejs build.js`
npm ERR! Exit status 127
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the fibers package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node build.js || nodejs build.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls fibers
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.1.13-boot2docker
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! cwd /output/bundle/programs/server
npm ERR! node -v v0.10.40
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0

[-]  Container build failed. meteor-tupperware is exiting...
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.
The command '/bin/sh -c sh /tupperware/scripts/on_build.sh' returned a non-zero code: 1

Deployment to Docker Hangs

Hi,

When I try to do a docker run in my local mac, it works. However, when I run it on docker linux it hangs...

[-] meteor-tupperware is starting your application with NODE_ENV=production and METEOR_ENV=production on port 80...
Note: you are using a pure-JavaScript implementation of bcrypt.
While this implementation will work correctly, it is known to be
approximately three times slower than the native implementation.
In order to use the native implementation instead, run

meteor npm install --save bcrypt

in the root directory of your application.

I tried a docker on ubuntu and docker swarm on Azure. Same problem.

You are attempting to run Meteor as the "root" user. Error with published meteor @1.4.2

Seems like meteor-tupperware is affected by this as well:

meteor/meteor#7959
abernix/meteord#3 (comment)

A build step failed: The command '/bin/sh -c sh /tupperware/scripts/on_build.sh' returned a non-zero code: 1

You are attempting to run Meteor as the "root" user. If you are developing, this is almost certainly *not* what you want to do and will likely result in incorrect file permissions. However, if you are running this in a build process (CI, etc.) or you are absolutely sure you know what you are doing, add the `--unsafe-perm` flag to this command to proceed.

How to add Meteor dependencies in Docker ?

I have a project depending on various Meteor packages. On my computer, I've added them using the following command:
meteor add raix:ui-dropped-event
Where should I specify the package dependencies when building my Meteor docker?
I try to modify the bower.json as follows:
"dependencies": { "raix:ui-dropped-event": "=0.0.7"
but the following error raised:
[-] Building your app...
[!] While attempting to build your application, the command: meteor build --directory /output --architecture os.linux.x86_64
[!] Failed with the exit code 1. The signal was null.
[-] The task produced the following stdout:
Bower: { [Error: Package paper not found] stack: [Getter] }
Bower: { [Error: Package raix:ui-dropped-event=raix:ui-dropped-event not found] stack: [Getter] }

Thanks for your advice!

Cannot build Meteor 1.3.2.4 in OSX

tar: .meteor/packages/babel-compiler/.6.6.4.12dw7o2++os+web.browser+web.cordova/npm/node_modules/meteor-babel: Cannot utime: Read-only file system
tar: .meteor/packages/babel-compiler/.6.6.4.12dw7o2++os+web.browser+web.cordova/npm/node_modules/meteor-babel: Cannot change mode to rwxr-xr-x: Read-only file system
tar: .meteor/packages/babel-compiler/.6.6.4.12dw7o2++os+web.browser+web.cordova/npm/node_modules: Cannot utime: Read-only file system
tar: .meteor/packages/babel-compiler/.6.6.4.12dw7o2++os+web.browser+web.cordova/npm/node_modules: Cannot change mode to rwxr-xr-x: Read-only file system
tar: .meteor/packages/babel-compiler/.6.6.4.12dw7o2++os+web.browser+web.cordova/npm: Cannot utime: Read-only file system
tar: .meteor/packages/babel-compiler/.6.6.4.12dw7o2++os+web.browser+web.cordova/npm: Cannot change mode to rwxr-xr-x: Read-only file system
tar: .meteor/packages/babel-compiler/.6.6.4.12dw7o2++os+web.browser+web.cordova: Cannot utime: Read-only file system
tar: .meteor/packages/babel-compiler/.6.6.4.12dw7o2++os+web.browser+web.cordova: Cannot change mode to rwxr-xr-x: Read-only file system
tar: .meteor/packages/babel-compiler: Cannot utime: Read-only file system
tar: .meteor/packages/babel-compiler: Cannot change mode to rwxr-xr-x: Read-only file system
tar: .meteor/packages: Cannot utime: Read-only file system
tar: .meteor/packages: Cannot change mode to rwxr-xr-x: Read-only file system
tar: .meteor: Cannot utime: Read-only file system
tar: .meteor: Cannot change mode to rwxr-xr-x: Read-only file system
tar: Exiting with failure status due to previous errors

Error : meteor build exit code: 1

hello Mr. @chriswessels
I am try with quickstart. but shows error like this :

Building your app...
An error occurred: meteor build exit code: 1
! Failure. Exiting...
The command '/bin/sh -c sh /tupperware/scripts/on_build.sh' returned a non-zero code: 1

Any idea about it ?
Thanks you verry much

Docker ignore file should be updated

Running the latest versions of meteor and npm-container, I had build issues running occurring only on Docker Hub.
Eventually found out they were caused by some packages/npm-container/.npm build folder.

Using this .dockerignore file fixed my problems :

.meteor/local
packages/*/.build*
packages/*/.npm*

Error: Module did not self-register

@chriswessels Firstly thanks for maintaining this resource.

While trying to build for meteor I get the following error below. It seems like NPM is not rebuilding binaries for the target environment. Possibly related to this issue: meteor/meteor#7512

Thanks in advance
/////////////////////////
/output/bundle/programs/server/node_modules/fibers/future.js:267
throw(ex);
^

Error: Module did not self-register.
at Error (native)
at Object.Module._extensions..node (module.js:434:18)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at bindings (/output/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/bcrypt/node_modules/bindings/bindings.js:76:44)
at Object. (/output/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/bcrypt/bcrypt.js:3:35)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)

Getting a missing Binary

Thanks for Tupperware...

Any ideas on the following issue pls:

> Starting app on port 3000...
## There is an issue with `node-fibers` ##
`/opt/meteor/dist/bundle/programs/server/node_modules/fibers/bin/linux-x64-57/fibers.node` is missing.

Try running this to fix the issue: /opt/nodejs/bin/node /opt/meteor/dist/bundle/programs/server/node_modules/fibers/build
/opt/meteor/dist/bundle/programs/server/node_modules/fibers/fibers.js:20
	throw new Error('Missing binary. See message above.');
	^

Error: Missing binary. See message above.
    at Object.<anonymous> (/opt/meteor/dist/bundle/programs/server/node_modules/fibers/fibers.js:20:8)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/opt/meteor/dist/bundle/programs/server/boot.js:1:75)
    at Module._compile (module.js:635:30)
Adams-MacBook-Pro:buzzy7 adamginsburg$ 

gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable

Building on quay.io.
Seems to be an issue with NPM dependencies, which require gyp, and hence python.

_ | |_ _ _ _ __ _ __ ___ _ ____ ____ _ _ __ ___ | | | | | '_ | '_ \ / _ \ '\ \ /\ / / _| '__/ _ \ | |_| |_| | |_) | |_) | **/ | \ V V / (_| | | | __/ \**|__,_| .**/| .**/ _**|_| \_/_/ \**,_|_| ___| |_| |_| [-] github.com/chriswessels/meteor-tupperware (tupperbuild v1.0.0) [-] No tupperware.json found, using defaults. [-] Downloading Meteor 1.3.2.4 Installer... 13[-] Installing Meteor 1.3.2.4... 14[-] Building your app... 15[-] Installing npm dependencies for your app... 16[!] While attempting to install your application's npm dependencies, the command: npm install 17[!] Failed with the exit code 1. The signal was null. 18[-] The task produced the following stdout: 19 > [email protected] install /output/bundle/programs/server/node_modules/fibers > node build.js || nodejs build.js 20[-] The task produced the following stderr: 21npm WARN package.json [email protected] No description npm WARN package.json [email protected] No repository field. npm WARN package.json [email protected] No README data npm WARN package.json [email protected] No license field. gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable. gyp ERR! stack at failNoPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:401:14) gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:330:11 gyp ERR! stack at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:69:16) gyp ERR! stack at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:81:29) gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/which.js:90:16 gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:44:5 gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/access.js:8:5 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:82:15) gyp ERR! System Linux 4.4.6-coreos gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release" gyp ERR! cwd /output/bundle/programs/server/node_modules/fibers gyp ERR! node -v v4.4.7 gyp ERR! node-gyp -v v3.3.1 gyp ERR! not ok Build failed sh: 1: nodejs: not found npm ERR! Linux 4.4.6-coreos npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" npm ERR! node v4.4.7 npm ERR! npm v2.15.8 npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR! [email protected] install:node build.js || nodejs build.js` npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the [email protected] install script 'node build.js || nodejs build.js'. npm ERR! This is most likely a problem with the fibers package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node build.js || nodejs build.js npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs fibers npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm ERR! npm owner ls fibers npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! /output/bundle/programs/server/npm-debug.log [-] Container build failed. meteor-tupperware is exiting... 9/27/2016, 2:35:04 PM
22Removing intermediate container 73e0c533eb90
23Removing intermediate container f4224362eaf4

docker build -t error occurred meteor build exit code:8

the source project with cordova support , I think it can't build cordova part. Any idea to jump or any logs to know the reason?

Building your app...

An error occurred: meteor build exit code: 8
! Failure. Exiting...
2015/08/31 05:51:29 The command [/bin/sh -c sh /tupperware/scripts/on_build.sh] returned a non-zero code: 1

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.