Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Error when docker build: lerna ERR! FILTER No packages remain after filtering [ 'a' ] #866

Closed
xzdwq opened this issue Jul 19, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@xzdwq
Copy link

xzdwq commented Jul 19, 2022

I use the project from the examples: https://github.com/rudxde/lerna-dockerize/tree/master/packages/lerna-dockerize/test/integration/simple

Desktop:

  • OS: Windows 10
  • Node v.16.13.1
  • Docker v.20.10.5

To Reproduce
Running commands:

  1. npm i && lerna bootstrap
  2. npx lerna-dockerize init
  3. npm run lerna-dockerize
  4. docker build -t test .

I get an error:

Step 9/35 : RUN npx lerna bootstrap --scope=a --includeDependencies
 ---> Running in d48c7eb76185
lerna notice cli v5.1.8
lerna notice filter including "a"
lerna notice filter including dependencies
lerna info filter [ 'a' ]
lerna ERR! EFILTER No packages remain after filtering [ 'a' ]
The command '/bin/sh -c npx lerna bootstrap --scope=a --includeDependencies' returned a non-zero code: 1

The example does not contain node dependencies, but even if you add packages to dependencies, the situation will not change. Most likely I'm doing something wrong, tell me the reason for my failure.

@xzdwq xzdwq added the bug Something isn't working label Jul 19, 2022
@rudxde
Copy link
Owner

rudxde commented Jul 22, 2022

Hi, thanks for your issue. There was a problem with the dockerfiles workdir in this (and other examples).

I have fixed the examples and the template from the init script to include the right workdir. They should work now as expected.


Background:

Lerna dockerize expects the root workdir to be at /app, but in the node image it is /. Telling Docker that the Workdir differs or changing the working dir for lerna-dockerize by setting dockerfileWorkingDir to /, can fix the issue. However, changing the default from lerna-dockerize would be a breaking change. Therefore I changed the documentation to include the workdir in the base dockerfiles.

@rudxde rudxde closed this as completed Jul 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants