You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Dockerfile for all the apps in my nx project are identical. Because of this I want to reuse a single Dockerfile for all the apps. The default behavior is that the nx-container executor uses the Dockerfile inside the app's directory. Because of this, I passed ../../Dockerfile, expecting that it would use the Dockerfile in the root of my nx project. What actually happens is that it just passes ../../Dockerfile as the file option to the build command which is not what I expected.
If I give a full path I would expect it to use the full path. And if I give it a relative path I would expect it to be relative to the default path. It even says that Dockerfile is the default in the documentation, but if I manually pass Dockerfile then that results in a different behavior.
"description": "Path to the Dockerfile (default Dockerfile)"
},
A "workaround" is to just pass ./Dockerfile as the file option and run the command in the root of the nx project. The problem with this, is that it now depends on the directory I run the command in. It is not that big of a problem to me because I only use the nx-container executor in a CI environment.
The text was updated successfully, but these errors were encountered:
The Dockerfile for all the apps in my nx project are identical. Because of this I want to reuse a single Dockerfile for all the apps. The default behavior is that the nx-container executor uses the Dockerfile inside the app's directory. Because of this, I passed
../../Dockerfile
, expecting that it would use the Dockerfile in the root of my nx project. What actually happens is that it just passes../../Dockerfile
as the file option to the build command which is not what I expected.This behavior comes from this line of code:
nx-tools/plugins/nx-container/src/executors/build/executor.ts
Line 21 in df60124
I expected it to work more like this:
If I give a full path I would expect it to use the full path. And if I give it a relative path I would expect it to be relative to the default path. It even says that
Dockerfile
is the default in the documentation, but if I manually passDockerfile
then that results in a different behavior.nx-tools/plugins/nx-container/src/executors/build/schema.json
Lines 87 to 90 in df60124
A "workaround" is to just pass
./Dockerfile
as thefile
option and run the command in the root of the nx project. The problem with this, is that it now depends on the directory I run the command in. It is not that big of a problem to me because I only use the nx-container executor in a CI environment.The text was updated successfully, but these errors were encountered: