Skip to content

Commit

Permalink
Build storage-service in Docker
Browse files Browse the repository at this point in the history
See #556.
  • Loading branch information
denkv committed Nov 20, 2023
1 parent 56df812 commit cf84458
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ build-controller:
# see platform-controller/Dockerfile

build-storage:
cd platform-storage/storage-service && mvn clean package -U
# see platform-storage/storage-service/Dockerfile

build-analysis:
cd analysis-component && mvn clean package -U
Expand All @@ -54,7 +54,7 @@ build-dev-analysis-image:
docker build -t hobbitproject/hobbit-analysis-component:dev ./analysis-component

build-dev-storage-image:
docker build -t hobbitproject/hobbit-storage-service:dev ./platform-storage/storage-service
docker build -t hobbitproject/hobbit-storage-service:dev --file ./platform-storage/storage-service/Dockerfile .

create-networks:
@docker network inspect hobbit >/dev/null || (docker network create -d overlay --attachable --subnet 172.16.100.0/24 hobbit && echo "Created network: hobbit")
Expand Down
13 changes: 10 additions & 3 deletions platform-storage/storage-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
FROM eclipse-temurin:11-focal

COPY target/storage-service.jar storage-service.jar
FROM maven:3-eclipse-temurin-11 AS build
WORKDIR /usr/src/hobbit-platform
COPY parent-pom/pom.xml parent-pom/
ARG project=platform-storage/storage-service
COPY ${project}/pom.xml ${project}/
RUN mvn --file ${project} dependency:go-offline
COPY ${project}/src ${project}/src
RUN mvn --file ${project} -Dmaven.test.skip=true package

FROM eclipse-temurin:11
COPY --from=build /usr/src/hobbit-platform/platform-storage/storage-service/target/storage-service.jar .
CMD ["java", "-cp", "storage-service.jar", "org.hobbit.core.run.ComponentStarter", "org.hobbit.storage.service.StorageService"]

0 comments on commit cf84458

Please sign in to comment.