dockerfile
eg:
# sea,20181122 FROM frolvlad/alpine-oraclejdk8:slim #add volume VOLUME /tmp #add project ADD icil-vat-service-0.0.1-SNAPSHOT.jar app.jar RUN sh -c 'touch /app.jar' ENV CE=$CE ENV JAVA_OPTS=$JAVA_OPTS ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar --spring.profiles.active=$CE" ]
使用:
1. Pull image from docker image private repository,use command likes: sudo docker pull $Image Name:$Image Tag 2. Run new container. sudo docker run -it -d --restart unless-stopped -p 8001:8001 --net host -e CE="dev" -e JAVA_OPTS="-Xmx128m -Xss512k" -v /opt/docker/icil-vat-service/log/:/tmp/log -m 500m --memory-reservation 500m $Image Name:$Image Tag QA: CE="dev" , test:CE="test" produce: CE=”pd” Eg: dev sudo docker run -it -d --restart unless-stopped -p 8001:8001 --net host -e CE="dev" -e JAVA_OPTS="-Xmx128m -Xss512k" -v /opt/docker/icil-vat-service/log/:/tmp/log -m 500m --memory-reservation 500m 113097154516.dkr.ecr.ap-southeast-1.amazonaws.com/icil-vat-service:20181122_1420
--net host --> 表示使用主机ip
-e JAVA_OPTS="-Xmx128m -Xss512k"