DOC: Explain Containerfile usage and fix docker build example (#41213)

Closes #41029

Signed-off-by: Somin Park <ps4708@naver.com>
This commit is contained in:
SoMin Park
2025-07-17 15:28:15 +09:00
committed by GitHub
parent 6c777403ed
commit 0d71b4ebe8

View File

@@ -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
----
<@profile.ifProduct>