yarn install error Couldn't find a package.json during Docker build

Yarn version: 0.21.2

Nodejs version: 6.9 and 4.7

  • Gitlab.com runners: How do I install and run software from an external repos?
  • Docker container doesn't start due to CMD and ENTRYPOINT
  • How to convert a Docker run command into a Swarm command?
  • Artifactory: “docker service create” does not work with images of 0 byte
  • Docker mount socket volume
  • Can't connect Docker + PostgreSQL 9.3
  • When running yarn locally it works

    When running npm install it works

    When running yarn install Dockerfile (docker build .) it fails with: error Couldn't find a package.json file in "/root/.cache/yarn/npm-readable-stream-2.2.2-a9e6fec3c7dda85f8bb1b3ba7028604556fc825e"

    I have absolutely no idea why.

    Step 16 : RUN yarn install
     ---> Running in 917c2b1b57fb
    yarn install v0.21.2
    [1/4] Resolving packages...
    [2/4] Fetching packages...
    error Couldn't find a package.json file in "/root/.cache/yarn/npm-readable-stream-2.2.2-a9e6fec3c7dda85f8bb1b3ba7028604556fc825e"
    info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
    The command '/bin/sh -c yarn install' returned a non-zero code: 1

    Yarn is installed this way in the Dockerfile

    RUN curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 0.21.2
    ENV PATH /root/.yarn/bin:$PATH

  • Docker Container interacting with 2 applications
  • Is it possible to see docker swarm internal DNS records?
  • Running gunicorn on ubuntu based image using docker-compose
  • How do get GoCD server to run persistently in Docker to run in a VM?
  • Dockerhub Repository Description
  • error when install tools in docker container
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.