Giter Site home page Giter Site logo

Comments (8)

Starefossen avatar Starefossen commented on May 4, 2024

Do you have a package.json in the same directory as you Dockerfile?

from docker-node.

arielelkin avatar arielelkin commented on May 4, 2024

No.

$ ls -a
.  ..  Dockerfile

from docker-node.

Starefossen avatar Starefossen commented on May 4, 2024

Well, there is your problem. The :onbuild image variant requires a package.json to be in the same directory as your Dockerfile.

from docker-node.

arielelkin avatar arielelkin commented on May 4, 2024

What? Doesn't this defeat the whole point of Docker?

from docker-node.

Starefossen avatar Starefossen commented on May 4, 2024

No, absolutely not. Also, the :onbuild image variant is a special purpose image.

Can you please read this guide on how to get your Node.js application into Docker: https://nodejs.org/en/docs/guides/nodejs-docker-webapp/

from docker-node.

arielelkin avatar arielelkin commented on May 4, 2024

I get it.. A package.json is required to build node. I'll keep reading up on it, thanks.

But please consider mentioning that in this repo's README.

from docker-node.

tianon avatar tianon commented on May 4, 2024

I thought we'd already added something about that, and it appears we did: (https://hub.docker.com/_/node/; referring specifically to the :onbuild variant)

The image assumes that your application has a file named package.json listing its dependencies and defining its start script.

Maybe it needs to be more obvious? (I'm sure it'd probably help if the fix for docker/hub-feedback#446 were pushed out 😢)

from docker-node.

arielelkin avatar arielelkin commented on May 4, 2024

I meant in https://github.com/nodejs/docker-node/blob/master/README.md

from docker-node.

Related Issues (20)

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.