From 0d71b4ebe8469068ba8c115e3fa876551ec2e730 Mon Sep 17 00:00:00 2001 From: SoMin Park <92261242+somln@users.noreply.github.com> Date: Thu, 17 Jul 2025 15:28:15 +0900 Subject: [PATCH] DOC: Explain Containerfile usage and fix docker build example (#41213) Closes #41029 Signed-off-by: Somin Park --- docs/guides/server/containers.adoc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/guides/server/containers.adoc b/docs/guides/server/containers.adoc index f3e168cf8b8..0f5fb47228d 100644 --- a/docs/guides/server/containers.adoc +++ b/docs/guides/server/containers.adoc @@ -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>