Skip to content
Snippets Groups Projects

Do not include secrets in the Docker image #71

Merged Martin Lowe requested to merge github/fork/autumnfound/malowe/master/71 into master
2 files
+ 7
13
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -11,22 +11,12 @@
#
# Then run the container using:
#
# docker run -i --rm -p 8090:8090 quarkus/mpc-rest-api-jvm
# docker run -i --rm -p 8090:8090 -v <full path to secret file folder>:/run/secrets --env config.secret.path=/run/secrets/secret.properties quarkus/mpc-rest-api-jvm
#
###
FROM fabric8/java-alpine-openjdk8-jre
## Where to copy the secret file, default to tmp
ARG SECRET_LOCATION=/tmp
ENV SECRET_LOCATION ${SECRET_LOCATION}
## Where to source the secret.properties file
ARG LOCAL_SECRETS=config/secret.properties
ENV LOCAL_SECRETS ${LOCAL_SECRETS}
## Copy the secret.properties to the given location
WORKDIR $SECRET_LOCATION
COPY $LOCAL_SECRETS secret.properties
ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dconfig.secret.path=${SECRET_LOCATION}/secret.properties"
ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
ENV AB_ENABLED=jmx_exporter
COPY target/lib/* /deployments/lib/
COPY target/*-runner.jar /deployments/app.jar
Loading