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

Yarn version: 0.21.2

Nodejs version: 6.9 and 4.7

  • Deploying a network of containers in a single K8s pod
  • How to run another docker container from application inside a docker container?
  • docker-machine with amazon ami HVM doesn't work
  • Mount a Virtualbox shared folder as a volume for Docker running on the guest OS
  • Docker Selenium-Chrome container memory utilization
  • What's the best practice to send logs to graylog from a JVM application which runs within a docker container?
  • 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 cannot access internet
  • Which tag of Ruby Docker image should I use?
  • how to create docker overlay network between multi hosts?
  • How to docker exec to IBM bluemix containers
  • Docker nginx redirect HTTP to HTTPS
  • Getting ember to run under docker on Windows Quickstart
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.