-
Notifications
You must be signed in to change notification settings - Fork 7.4k
DOC: Explain Containerfile usage and fix docker build example #41213
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,8 @@ For the best start up of your {project_name} container, build an image by runnin | |
This step will save time in every subsequent start phase of the container image. | ||
|
||
=== Writing your optimized {project_name} Containerfile | ||
NOTE: A Containerfile is functionally identical to a Dockerfile and uses the same syntax. The term "Containerfile" is used to be more tool-agnostic, especially in non-Docker environments like Podman or Buildah. When using Docker, you have two options: either name your file `Dockerfile` (which Docker expects by default), or keep the name `Containerfile` and specify it explicitly using the `-f` flag: `docker build -f Containerfile -t mykeycloak .` | ||
|
||
The following `Containerfile` creates a pre-configured {project_name} image that enables the health and metrics endpoints, enables the token exchange feature, and uses a PostgreSQL database. | ||
|
||
.Containerfile: | ||
|
@@ -147,7 +149,11 @@ To build the actual container image, run the following command from the director | |
|
||
[source,bash] | ||
---- | ||
podman|docker build . -t mykeycloak | ||
podman build . -t mykeycloak | ||
# or for Docker (specify the Containerfile explicitly): | ||
docker build -f Containerfile . -t mykeycloak | ||
# or rename Containerfile to Dockerfile and use: | ||
docker build . -t mykeycloak | ||
Comment on lines
+152
to
+156
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ahus1 IIRC, we also have a logic somewhere to replace There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll check once I review that follow-up PR |
||
---- | ||
|
||
<@profile.ifProduct> | ||
|
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 if this note shouldn't have been excluded for product.
CC @ahus1
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.
Yes ... @mabartos or @somln, can you please wrap that? If you do it straight away, use the same issue number and create another PR.
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.
Thanks for the clarification, @ahus1!
@vmuzikar – I’ll submit a follow-up PR shortly with the note wrapped in
ifdef::!product[]
, referencing #41029.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.
@vmuzikar Good point, thanks for the additional consideration.