I have a docker image that have the following Dockerfile
content:
FROM openjdk:8
ENV MYHOME /home/docker
ARG JAR_FILE
ENV JAR ${JAR_FILE}
COPY $JAR_FILE ${MYHOME}/$JAR_FILE
WORKDIR ${MYHOME}
ENTRYPOINT ["sh", "-c", "java -jar ${MYHOME}/${JAR} --spring.profiles.active=docker,foo"]
When I try to include this docker image in a docker compose file together with other images, I want to override Spring active profiles.
I tried using the following docker-compose.yml
content:
...
my_image:
image: my_image
environment:
SPRING_PROFILES_ACTIVE: 'docker,bar'
...
But when runnig the docker compose with the above configuration and looking into the container log, I found that the active profiles are:
...
The following profiles are active: docker,foo
...
In my case, how can I set the docker,bar profiles using docker compose?