Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Yarn build trigger error Command "build" not found in Docker #304

Open
alexisrolland opened this issue Jun 17, 2021 · 1 comment
Open

Yarn build trigger error Command "build" not found in Docker #304

alexisrolland opened this issue Jun 17, 2021 · 1 comment

Comments

@alexisrolland
Copy link

alexisrolland commented Jun 17, 2021

Hello and thank you for building Strapi. It looks awesome.

I'm building a custom Docker image based on the file:
https://github.com/strapi/strapi-docker/blob/master/examples/custom/Dockerfile

The command RUN yarn build triggers the error message:

RUN yarn build:
#11 0.577 yarn run v1.22.5
#11 0.649 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
#11 0.649 error Command "build" not found.

Research on StackOverflow points out this is because the file package.json is lacking the build key:
https://stackoverflow.com/questions/55789355/build-node-js-app-using-yarn-but-getting-error-command-build-not-found

I think this is because I reused the whole code base from the root of the repo here: https://github.com/strapi/strapi-docker
And indeed the package.json does not contain much: https://github.com/strapi/strapi-docker/blob/master/package.json

  • Am I missing something?
  • Am I using the right code base to build a custom Strapi image?

Thank you

PS: I cannot use the prebuilt image strapi/strapi due to network restrictions in my environment which prevents me to download dependencies from the public NPM registry.

@nefarioustim
Copy link

To build the images, you need to run the build script. This is documented, but it's right at the bottom of the README so pretty easy to miss. Run the following commands in your shell:

yarn install
./bin/build.js

You can get help on the build script using:

./bin/build.js

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants