-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
61 lines (50 loc) · 2 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#
# Copyright (C) 2021-2024 EmbeddedKittens contributors
#
# This file is part of EmbeddedKittens.
#
# EmbeddedKittens is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# EmbeddedKittens is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with EmbeddedKittens. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-FileCopyrightText: 2021-2024 EmbeddedKittens contributors
# SPDX-License-Identifier: GPL-3.0-or-later
#
# Container image for building the project
FROM docker.io/library/maven:3-eclipse-temurin-17 AS build
LABEL maintainer="Benedikt Fein <[email protected]>"
# Parameter for skipping the tests in the build process
ARG SKIP_TESTS=true
WORKDIR /build
# Copy files and directories needed for building
COPY pom.xml ./
COPY src ./src
# Build the project
# The -e flag is to show errors and -B to run in non-interactive aka “batch” mode
# Lastly, make build-artifact naming version-independent
RUN : \
&& mvn -e -B package -DskipTests=${SKIP_TESTS} \
&& mkdir -p /build/bin \
&& mv target/embedded-kittens-*.full.jar bin/embedded-kittens.jar \
&& :
# Slim container image for running EmbeddedKittens
FROM docker.io/library/eclipse-temurin:17-jre
LABEL maintainer="Benedikt Fein <[email protected]>"
WORKDIR /embedded-kittens
VOLUME /embedded-kittens
# Copy the jar from the builder to this container
COPY --from=build /build/bin /embedded-kittens-bin
# The executable is EmbeddedKittens
ENTRYPOINT ["java", "-jar", "/embedded-kittens-bin/embedded-kittens.jar"]
# The default argument is the help menu
# This can be overidden on the command line
CMD ["--help"]