+
Skip to content

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

Merged
merged 1 commit into from
Jul 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docs/guides/server/containers.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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 .`
Copy link
Contributor

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

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.


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:
Expand Down Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahus1 IIRC, we also have a logic somewhere to replace podman|docker with just podman, correct? So this won't work for prod either, AFAICT.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll check once I review that follow-up PR

----

<@profile.ifProduct>
Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载