jshimko / meteor-launchpad

A base Docker image for Meteor applications.
https://hub.docker.com/r/jshimko/meteor-launchpad/
MIT License
276 stars 152 forks source link

devbuild and latest errors - first time user #23

Closed rhicks closed 7 years ago

rhicks commented 7 years ago

Trying to use meteor-launchpad for the first time today.

Getting different errors with "devbuild" and "latest". Probably something I am doing incorrectly. Please point me in the right direction.

devbuild:

Dockerfile FROM jshimko/meteor-launchpad:devbuild

Error:

$ docker build -t rhicks/app .
Sending build context to Docker daemon 35.84 kB
Step 1 : FROM jshimko/meteor-launchpad:devbuild
# Executing 6 build triggers...
Step 1 : RUN bash $BUILD_SCRIPTS_DIR/install-meteor.sh
 ---> Using cache
Step 1 : COPY . $APP_SOURCE_DIR
Step 1 : RUN $BUILD_SCRIPTS_DIR/build-meteor.sh
 ---> Running in a28cea4f3b27

[-] Running npm install in app directory...

npm WARN enoent ENOENT: no such file or directory, open '/opt/meteor/src/package.json'
npm WARN src No description
npm WARN src No repository field.
npm WARN src No README data
npm WARN src No license field.

[-] Building Meteor application...

build: You're not in a Meteor project directory.

To create a new Meteor project:
  meteor create <project name>
For example:
  meteor create myapp

For more help, see 'meteor --help'.
The command '/bin/sh -c $BUILD_SCRIPTS_DIR/build-meteor.sh' returned a non-zero code: 1

latest:

Dockerfile FROM jshimko/meteor-launchpad:latest

Error:

$ docker build -t rhicks/app .
Sending build context to Docker daemon 35.84 kB
Step 1 : FROM jshimko/meteor-launchpad:latest
# Executing 5 build triggers...
Step 1 : COPY . $APP_SOURCE_DIR
Step 1 : RUN bash $BUILD_SCRIPTS_DIR/install-phantom.sh
 ---> Running in bab0d8d995fd
Step 1 : RUN bash $BUILD_SCRIPTS_DIR/install-mongo.sh
 ---> Running in fa5fe541fad4
Step 1 : RUN bash $BUILD_SCRIPTS_DIR/install-graphicsmagick.sh
 ---> Running in 308c27b31e19
Step 1 : RUN cd $APP_SOURCE_DIR &&             bash $BUILD_SCRIPTS_DIR/install-meteor.sh &&             bash $BUILD_SCRIPTS_DIR/build-meteor.sh &&             bash $BUILD_SCRIPTS_DIR/post-build-cleanup.sh
 ---> Running in f461603b79af
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  7786    0  7786    0     0  10090      0 --:--:-- --:--:-- --:--:-- 10085
head: cannot open '/opt/meteor/src/.meteor/release' for reading: No such file or directory

[-] Installing Meteor ...

Downloading Meteor distribution
Retrying download in 5 seconds...
Retrying download in 5 seconds...
Retrying download in 5 seconds...
Retrying download in 5 seconds...
Retrying download in 5 seconds...
Retrying download in 5 seconds...
Retrying download in 5 seconds...
Retrying download in 5 seconds...
Retrying download in 5 seconds...
Retrying download in 5 seconds...
The command '/bin/sh -c cd $APP_SOURCE_DIR &&             bash $BUILD_SCRIPTS_DIR/install-meteor.sh &&             bash $BUILD_SCRIPTS_DIR/build-meteor.sh &&             bash $BUILD_SCRIPTS_DIR/post-build-cleanup.sh' returned a non-zero code: 1
jshimko commented 7 years ago

Looks like you aren't using this from the root of a Meteor app. Both the package.json and the .meteor/release file are missing.

jshimko commented 7 years ago

I don't think this is an issue with this project, so I'm going to close this for now. Let me know if you run into any more problems.

ghost commented 7 years ago

I am getting "Retrying download in 5 seconds" when using jshimko/meteor-launchpad:latest as a base image. I want to build wekan with .meteor/release set to METEOR@1.3.5.1

jshimko commented 7 years ago

@centigrade-thomas-becker This issue is closed, so it's generally a good idea to file a new one if you think there's a valid bug. However, if your error is the same as the original post, that's a usage error and not a problem with this project. Note the error messages in his two comments:

# missing package.json

[-] Running npm install in app directory...

npm WARN enoent ENOENT: no such file or directory, open '/opt/meteor/src/package.json'
...

[-] Building Meteor application...

build: You're not in a Meteor project directory.

and...

# missing .meteor/release

head: cannot open '/opt/meteor/src/.meteor/release' for reading: No such file or directory

That means meteor-launchpad isn't able to find those files (which is why the Meteor build/download is failing). That usually means you're not running the docker build command from the root of a Meteor project or you're not specifying the correct path at the end of the docker build command.

Just to confirm, I just cloned, built, and ran Wekan using this base image with no issues, so I recommend taking a closer look at your setup. If you feel like you found an issue, certainly feel free to open a new issue.

git clone https://github.com/wekan/wekan.git

cd wekan

echo "FROM jshimko/meteor-launchpad:latest" > Dockerfile

docker build -t wekan-test .
mklueh commented 7 years ago

In my case the problem was, that my Dockerfile was located in a subdirectory ./docker/application/Dockerfile, but it has to be in the root of the project

jshimko commented 7 years ago

@Mklueh Your Dockerfile can be wherever you want. You just have to specify the path with the -f flag if it's not in the directory you're currently in. And the final argument of the docker build command is always the path of the app root - usually just specified by a dot (.) if you're running the command from the app root.

# the standard format (assuming everything is in the app root)
docker built -t myImageName .

# if you're in the root of the app, but the Dockerfile isn't
docker built -f ./path/to/Dockerfile -t myImageName .

# if you're somewhere else entirely
docker built -f ./path/to/Dockerfile -t myImageName ./path/to/app/root

So in short, you can put your Dockerfile wherever you want and you can run the build command from wherever you want. But if you're not in the app root, you have to specify where everything is when running the docker build command.

https://docs.docker.com/engine/reference/commandline/build/

averissimo commented 6 years ago

I was experiencing the same issue from the root of the directory, but didn't have .meteor/release (working in development in my laptop and trying right now to publish a test deployment in a server)

I would suggest to make it clear in README.md that .meteor/release file is required.

note: I'm a newbie and really don't know how unusual it is to have that out of the git tree.

Cheers!!