-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
build: add manuals section about named contexts #21672
Conversation
✅ Deploy Preview for docsdocker ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
# syntax=docker/dockerfile:1 | ||
FROM buildbase | ||
WORKDIR /app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a nice pattern is to define src
and docs
as scratch otherwise it will not find the stage if no named context is defined:
# syntax=docker/dockerfile:1 | |
FROM buildbase | |
WORKDIR /app | |
# syntax=docker/dockerfile:1 | |
FROM scratch AS src | |
FROM scratch AS docs | |
FROM buildbase | |
WORKDIR /app |
I wonder if src
as named context is necessary though. I think we could just have docs
one as named context that would run make manpages
only if /app/docs
folder has files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, personally. Defining named contexts as empty stages... it feels a bit like a hack? I guess this is useful mostly when named contexts can be considered "optional"? Maybe we should have a section dedicated to that instead.
My concern with showing this pattern in the "main" example is that people might think this is the required syntax (define as an empty stage in the Dockerfile, override it on the command line).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should have a section dedicated to that instead.
Yes good point that could be another section
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
94cabc9
to
b9a3f19
Compare
Description
Adds a section on the build contexts page about named contexts.
Related issues or tickets