-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker context (directory) not set consistently? #974
Comments
Not sure if the same issue but as of NX 20.0.0 I cannot use this tool as it appears to be referencing the root DOCKERFILE to build apps which are normally pointing to their own app-level dockerfile. |
Any news on the issue in 20.0.0? |
Just to let people know if you manually set the context reference in the project.json you can overcome what was before a default to the project. It unblocks the migration to NX |
Can you maybe please show how the config would look like? We just upgraded to 20 and no matter what options we set we always get the error that the Dockerfile can't be found. Our Dockerfiles are all in each app's root directory and everything was working fine until the upgrade to 20. Thanks |
I'm new to Nx, so not sure if / how this is supposed to work, but here goes:
I want to create a nginx base-container that will be used by some of the other containers in the monorepo.
I create a new folder "Applications\nginx", (where all the other applications are located) and added package.json and project.json. (Content at the end)
Then I add a nginx.conf with appropriate content, and created the Dockerfile with this content:
By coincidence, I was in the Applications\nginx directory. when I ran
nx run nginx-base-image:container
This was working as it should. However then I navigated to the root of the project and ran
nx run nginx-base-image:container
again. Now the container could not be built. I had to change Dockerfile to this:Does this mean that the docker build context is just set by random to whatever directory i'm starting the build from?
BTW: I'm using Rancher Desktop, not Docker Desktop, and I get this to the console when building:
--- Other files
package.json:
project.json:
The text was updated successfully, but these errors were encountered: