27 lines
938 B
Plaintext
27 lines
938 B
Plaintext
|
# The build stage uses debian:11 which is the same
|
||
|
# base image as openjdk:11
|
||
|
FROM docker.io/library/debian:11 AS builder
|
||
|
|
||
|
ARG version=1.0.4
|
||
|
|
||
|
RUN mkdir --parents /source
|
||
|
ADD https://github.com/sevdokimov/log-viewer/releases/download/v$version/log-viewer-$version.tar.gz /source/release.tar.gz
|
||
|
RUN ls /source/
|
||
|
RUN tar -C /source/ -xf /source/release.tar.gz
|
||
|
RUN mv /source/log-viewer-$version /source/log-viewer
|
||
|
|
||
|
FROM docker.io/library/openjdk:11
|
||
|
|
||
|
RUN mkdir --parents /app /logs
|
||
|
|
||
|
# Copy files from log-viewer release
|
||
|
COPY --from=builder /source/log-viewer/lib /app/lib
|
||
|
COPY --from=builder /source/log-viewer/logviewer.sh /app/logviewer.sh
|
||
|
COPY --from=builder /source/log-viewer/config.conf /config.conf
|
||
|
|
||
|
# expose the port the the service will run on
|
||
|
EXPOSE 8111
|
||
|
|
||
|
# command that is executed when the docker container starts
|
||
|
CMD ["java", "-ea", "-Dlog-viewer.config-file=/config.conf", "-jar", "/app/lib/log-viewer-cli-1.0.4.jar", "startup"]
|