Dockerfile documentation (for the back-end project deployment)

Dockerfile documentation (for the back-end project deployment)


This tutorial is based on personal understanding and field-proven correct, hereby recorded when the right notes.

Note: linux-based operating system (sensitive information have been processed)

This article combined with another blog tutorial together constitute the back-end service deployment, hereby record does not resolve detail detailed analysis of the role of Dockerfile and internal instructions, personal understanding is greater than the agreed configuration, learning docker or nginx, etc. These tools are just learn to create their man had agreed to tools, such as I agreed ENTRYPOINT keyword Dockerfile in order for the mirrored entry for the agreed documents required for the construction of a mirror when Dockerfile, and so on.

FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
ARG PROFILE
ENV SPRING_PROFILE=$PROFILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom ","-jar","/app.jar","--spring.profiles.active=${SPRING_PROFILE}"]

Above to the effect that: the first base image acquisition, the host / tmp directory mounted to the mirror, and then execute the acquired build command parameters, there are two parameters, a jar package directory jar_file host computer, selecting the PROFILE which use a configuration file (different environments unreasonable configuration file), the specific implementation of the command I can refer to another article, not repeat them here. The jar is then copied to the mirror package, the final definition of the container run command to be executed.

Guess you like

Origin www.cnblogs.com/tian874540961/p/11915764.html