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
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:
FROM docker.io/nginx:stable-alpine
COPY /nginx.conf /etc/nginx/nginx.conf
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:
FROM docker.io/nginx:stable-alpine
COPY Applications/nginx/nginx.conf /etc/nginx/nginx.conf
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:
> Buildx version
[command]"C:\Program Files\Rancher Desktop\resources\resources\win32\bin\docker.exe" buildx version
github.com/docker/buildx v0.12.0 542e5d810e4a1a155684f5f3c5bd7e797632a12f
Unsupported CI Provider... Using Local Environment as fallback
[command]"C:\Program Files\Git\cmd\git.exe" log -1 --pretty=format:%ae
plamen.totev@icb.bg[command]"C:\Program Files\Git\cmd\git.exe" symbolic-ref HEAD
refs/heads/master
[command]"C:\Program Files\Git\cmd\git.exe" rev-parse HEAD
01ea355452c4bce35ce9916d50ce46d08d7a4b54
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: