Docker IntelliJ
手順
- create dockerfile
- Start with a base image containing Java runtime (mine java 8)
- Add Maintainer Info
- Add a volume pointing to /tmp
- Make port 8080 available to the world outside this container
- The application's jar file (when packaged)
- Add the application's jar to the container
npm install touch-cli -g
touch Dockerfile
FROM openjdk:8u212-jdk-slim
LABEL maintainer="your@email.com"
VOLUME /tmp
EXPOSE 8080
ARG JAR_FILE=target/codestatebkend-0.0.1-SNAPSHOT.jar
ADD ${JAR_FILE} codestatebkend.jar
Run the jar file
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/codestatebkend.jar"]
docker build -t <appname> .