To run Infinispan with Docker Compose, define an Infinispan Server service using the official quay.io/infinispan/server:16.2 image, publish port 11222, and configure credentials. Use an image entry alone for the prebuilt server; add a Dockerfile and build entry when you need a derivative image. The examples below use the 16.2 tag shown in Infinispan’s getting-started guidance; check that the tag is still available and choose a version deliberately before deploying.
Start Infinispan with a prebuilt image
Create a file named compose.yaml in your project directory:
services:
infinispan:
image: quay.io/infinispan/server:16.2
ports:
- "11222:11222"
environment:
USER: admin
PASS: change-me
Start the service from that directory with docker compose up -d. Compose downloads the image if it is not already local, then starts the server. The host port 11222 maps to the container’s documented default server port, so clients on the same machine can connect through localhost:11222. Replace the example password with a suitable value for your environment.
Infinispan Server’s official container image is available through Docker Hub and Quay.io. The example uses Quay.io and a versioned tag; avoid relying on an unpinned or changing tag when you need repeatable deployments.
#1 Best Overall
Choose between an official image and a custom image
Use the prebuilt server image
For a standard server, specify image and omit build. This is the simplest option when configuration can be supplied through environment variables, mounted files, or the server command line.
Build a derivative image
Add a Dockerfile and build context when you need to package files or dependencies into an image. Compose’s build specification supports a context and Dockerfile, and you can assign the resulting image a name:
services:
infinispan:
image: my-org/infinispan-custom:16.2
build:
context: .
dockerfile: Dockerfile
ports:
- "11222:11222"
Here, context: . makes the current directory available to the build, and dockerfile: Dockerfile identifies the build instructions. The service’s image value names the built image. Use a Dockerfile derived from the official Infinispan Server image when creating a custom server image; the Compose definition alone does not specify what that Dockerfile should contain.
Mount configuration and provision identities
For configuration that should remain outside the image, bind-mount a host directory read-only and pass the configuration file to the server with -c. You can also point IDENTITIES_BATCH at a batch file containing offline CLI identity commands:
Rank #3
services:
infinispan:
image: quay.io/infinispan/server:16.2
ports:
- "11222:11222"
volumes:
- ./user-config:/user-config:ro
environment:
IDENTITIES_BATCH: /user-config/identities.batch
command: ["-c", "/user-config/my-infinispan-config.xml"]
Place identities.batch and my-infinispan-config.xml in the host’s user-config directory before starting the service. The read-only mount lets the container read those files without writing changes back to the host. IDENTITIES_BATCH runs offline CLI identity commands before server startup; commands that need a running server, such as creating a cache, cannot succeed in this phase.
The image also supports JAVA_OPTIONS for Java properties and SERVER_LIBS for artifacts specified as Maven coordinates, URLs, or archives. Use these when the server needs additional JVM settings or libraries, rather than assuming that a mounted configuration file handles those needs.
Configure authentication for your deployment
Authentication is enabled by default on all exposed endpoints in the Infinispan Server container image. For initial development, the image can generate credentials or accept the USER and PASS environment variables, as shown in the first Compose example. For a controlled deployment, use an identities batch file to define users and roles instead of treating the sample credentials as production-ready.
Clients must use credentials that match the server configuration. Hot Rod clients also need to use the documented DIGEST-SHA-256 SASL mechanism. Compose publishes the endpoint; it does not automatically configure each application client to authenticate.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Best Value
- Docker, Docker Swarm, Docker Compose, Programmer, Developer, Coding, Programming, Software Engineer, Code, DevOps, Deploy, Deployment, Kubernetes, Salt, Puppet, Chef, Terraform, Container, AWS, Azure, Cloud, Geek, Funny, Computer, Software, Tech, IT
- Integration, Scrum, Compile, Compilation, Science, Bug, Debug, Python, Linux, Java, Javascript, Scala, Dotnet, Kotlin
- Lightweight, Classic fit, Double-needle sleeve and bottom hem
Add dependencies, storage, and health checks as needed
Compose dependent services
If your Infinispan configuration uses a cache store backed by a database, define the database as another Compose service and configure Infinispan to connect to it. A historical Infinispan example from December 5, 2016 paired the server with Oracle Database and mounted custom configuration, a driver or module, and server configuration. That example illustrates the multi-container pattern, but it is not a current image-version recommendation.
Use named volumes when data must survive container replacement
A Compose named volume can provide persistent storage when your server setup writes data to a configured location. Declaring a volume alone does not establish which Infinispan data it persists: configure the server to use the mounted path, and confirm the path and persistence behavior for the configuration you deploy.
Check server health
Infinispan documents REST liveness and readiness checks at /rest/v2/cache-managers/default/health/status on port 11222. A monitoring or orchestration setup can use that endpoint to check the server’s health; publishing the port in Compose does not itself add a health check to the service.
Use a different deployment approach for a cluster
A Compose service definition is a convenient way to run a local server and its dependencies; it is not, by itself, a clustered deployment configuration. For Kubernetes or OpenShift, Infinispan’s guidance notes that multicast discovery is unavailable and recommends the Kubernetes JGroups stack with DNS_PING and a jgroups.dns.query value. Configure discovery for the target platform rather than carrying over local Compose assumptions.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

