Skip to content

Latest commit

 

History

History
26 lines (25 loc) · 1.03 KB

File metadata and controls

26 lines (25 loc) · 1.03 KB

Dockerfile with explanations

# maybe to be used in future (uses jlink to shrink jdk)
# https://blog.gilliard.lol/2018/11/05/alpine-jdk11-images.html
# I tried to find a v 11 alpine image but was unable to, hence ^ byo
# this is based on debian, the alpine v 8 jkd is 100MB, this one is 400MB

FROM openjdk:11-oracle
LABEL maintainer="P Campbell" email="pcampbell.edu@gmail.com" modified="2020-03-26"
  • # comments, as with bash scripts
  • FROM the base image to be pulled from docker hub, you choose a base image that has most of what you want or your start with a basic image (python, apache, php etc.)
  • LABEL user defined meta data for the container image
WORKDIR /usr/local/myapp
  • WORKDIR effectively a cd on the container filesystem
COPY *.class ./
COPY menu.sh .
  • COPY copy from the local host to the container n.b. multiple source files require the trailing /
CMD sh --version;java -version ; sh menu.sh
  • CMD: command to be run when the container is run, this is the shell format ( [] for the exe format )