We want to investigate how compatible our Docker Compose support is with Bitnami container images. The first part of this is the names of the images as we use the name to determine the type of the service in the container. If these don't match up, the org.springframework.boot.service-connection label can be used to as something of a workaround but it would be nice if it wasn't necessary. The second part of this is the environment variables in the started container that we look for to learn how to connect to the service. If the Binami images use different environment variables, we won't be able to figure out how to connect. I'm not sure that this can be worked around – perhaps by a user configuring custom environment variables that alias one variable to another – but this would be even clunkier than the image name workaround.
Comment From: wilkinsona
Results of using the changes in this branch to try the Bitnami container images:
| Official | Bitnami | Notes |
|---|---|---|
| cassandra | bitnami/cassandra | Basics work with org.springframework.boot.service-connection: cassandra |
| elasticsearch | bitnami/elasticsearch | Service never becomes ready (Connection refused) |
| gvenzl/oracle-xe | No Bitnami image available | |
| mariadb | bitnami/mariadb | Basics work with org.springframework.boot.service-connection: mariadb |
| mongo | bitnami/mongodb | Basics work with org.springframework.boot.service-connection: mongo |
| mssql/server | No Bitnami image available | |
| mysql | bitnami/mysql | Basics work with org.springframework.boot.service-connection: mysql |
| openzipkin/zipkin | No Bitnami image available | |
| postgres | bitnami/postgresql | Basics work with org.springframework.boot.service-connection: postgres |
| rabbitmq | bitnami/rabbitmq | Basics work with org.springframework.boot.service-connection: rabbitmq |
| redis | bitnami/redis | Container fails to start as neither REDIS_PASSWORD nor ALLOW_EMPTY_PASSWORD is set |
This testing is fairly superficial. A second pass to look at the environment variables that each container supports and whether they work as expected is the next step.
Comment From: mpermar
I'm likely stating the obvious here but the following changes fix the Elasticsearch and Redis composes:
services:
elasticsearch:
image: 'elasticsearch:8.6.1'
environment:
- 'ELASTIC_PASSWORD=secret'
- 'ES_JAVA_OPTS=-Xmx1024m'
- 'xpack.security.enabled=false'
- 'discovery.type=single-node'
ports:
- '9200'
- '9300'
and
services:
redis:
image: 'bitnami/redis:7.0'
environment:
- 'ALLOW_EMPTY_PASSWORD=yes'
ports:
- '6379:6379'
labels:
org.springframework.boot.service-connection: redis