forked from kmgowda/SBK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-template
51 lines (38 loc) · 1.38 KB
/
docker-template
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
##
# Copyright (c) KMG. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
##
# Building Container
FROM gradle:7.2.0-jdk17 as GradleBuilder
MAINTAINER Keshava Munegowda <[email protected]>
USER root
COPY ca-certificates/* /usr/local/share/ca-certificates/
RUN update-ca-certificates
ENV APP_NAME=sbk
ENV APP_HOME=/opt/${APP_NAME}
WORKDIR /opt/sbk
COPY --chown=root:root gradle ${APP_HOME}/gradle
COPY --chown=root:root build.gradle ${APP_HOME}/build.gradle
COPY --chown=root:root gradle.properties ${APP_HOME}/gradle.properties
COPY --chown=root:root settings.gradle ${APP_HOME}/settings.gradle
COPY --chown=root:root gradlew ${APP_HOME}/gradlew
COPY --chown=root:root checkstyle ${APP_HOME}/checkstyle
COPY --chown=root:root sbk-api ${APP_HOME}/sbk-api
# Copy the SBK storage drivers
COPY@SBK
ENV GRADLE_USER_HOME=/opt/SBK
RUN gradle build --no-daemon --info --stacktrace
# Runtime Container
FROM openjdk:17.0-jre
ENV APP_NAME=sbk
ENV APP_HOME=/opt/${APP_NAME}
COPY --from=GradleBuilder ${APP_HOME}/build/distributions/${APP_NAME}-*.tar /opt/${APP_NAME}.tar
RUN tar -xvf /opt/${APP_NAME}.tar -C /opt/.
RUN mv /opt/${APP_NAME}-* /opt/${APP_NAME}
EXPOSE 9718
ENTRYPOINT ["/opt/sbk/bin/sbk"]