Docker plugin feedback #33996
aqeelat
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently trying to move our angular apps into a monorepo. In their individual repos, the apps have this dockerfile:
when a PR is merged to main, we publish and tag with latest, and when a release is created, we tag with stable and the release tag.
I'm trying to replicate this behavior in the nx monorepo, and I faced a couple of issues.
1. build context
The command that gets run is
docker build . --tag apps-hello-worldand runs from inside the app folder. This means that it cannot access the root dist folder and that we have to change the output path from"dist/apps/hello-world"to "apps/hello-world/dist".Solution
Changing the command to be
docker build . -f apps/hello-world/Dockerfileand running from the root folder.Workaround
I added this to the plugin args:
--build-context dist=../../distand replaced the COPY line to beCOPY --from=dist /apps/hello-world .2. multi-tags
I really wish that we can assign multiple tags to the built image. Especially for rolling tags such as edge, latest, stable, or whatever.
3. env variable interpolation
It would be amazing if we can add env variables in nx.json that can then be replaced during ci, with a fallback value. One usage for this is dynamically setting the docker registry url.
Beta Was this translation helpful? Give feedback.
All reactions