I am creating a docker image using below configuration. Once image is ready i want to pass JAVA_OPTS to my docker container, so it can be passed to my spring boot application. Whenever i try to bring up the container i am getting "runtime create failed: container_linux.go:348: starting container process caused "exec: \"java $JAVA_OPTS\": executable file not found in $PATH": unknown" error. Am i missing something ? Any help is really appreciated
Dockerfile
FROM openjdk:8-jdk-alpine
LABEL maintainer="[email protected]"
# Add a volume pointing to /tmp
VOLUME /tmp
# Make port 8080 available to the world outside this container
EXPOSE 8080
# The application's jar file
ARG JAR_FILE=target/my.jar
# Add the application's jar to the container
ADD ${JAR_FILE} my.jar
ENV JAVA_OPTS=""
# Run the jar file
ENTRYPOINT ["java $JAVA_OPTS","-Djava.security.egd=file:/dev/./urandom","-jar","/my.jar"]
docker-compose
version: '2.1'
services:
service1:
hostname: test
domainname: mydomain.com
image: myimage:latest
container_name: test-container
environment:
- JAVA_OPTS=-Dapp.clients.scheme=http -Dapp.clients.port=9096 -Dserver.port=8082
ports:
- "8082:8082"