diff --git a/Dockerfile b/Dockerfile index 5860f91..9551258 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,11 +15,22 @@ RUN mvn io.quarkus:quarkus-maven-plugin:0.12.0:create \ -DclassName="org.acme.quickstart.GreetingResource" \ -Dpath="/hello" COPY pom.xml . -RUN mvn package -RUN rm -r src target mvnw* && ls -l +RUN mvn package && \ + rm -r src target mvnw* && \ + ls -l COPY . . RUN mvn -o package +# Same as Yolean/kubernetes-kafka +FROM solsson/jdk-opensource:11.0.2@sha256:9088fd8eff0920f6012e422cdcb67a590b2a6edbeae1ff0ca8e213e0d4260cf8 \ + as runtime-plainjava + +WORKDIR /app +COPY --from=maven-build /workspace/target/lib ./lib +COPY --from=maven-build /workspace/target/*-runner.jar ./quarkus-kafka.jar + +ENTRYPOINT [ "java", "-cp", "./lib/*", "-jar", "./quarkus-kafka.jar" ] + FROM alpine:3.9@sha256:644fcb1a676b5165371437feaa922943aaf7afcfa8bfee4472f6860aad1ef2a0 as snappy-mod RUN apk add --no-cache zip @@ -37,7 +48,7 @@ FROM oracle/graalvm-ce:1.0.0-rc14@sha256:ea22ec502d371af47524ceedbe6573caaa59d51 WORKDIR /project COPY --from=maven-build /workspace/target/lib ./lib COPY --from=snappy-mod /workspace/target/lib/* ./lib/ -COPY --from=maven-build /workspace/target/*.jar ./ +COPY --from=maven-build /workspace/target/*-runner.jar ./ # from Quarkus' maven plugin mvn package -Pnative -Dnative-image.docker-build=true # but CollectionPolicy commented out due to "Error: policy com.oracle.svm.core.genscavenge.CollectionPolicy cannot be instantiated." diff --git a/build-contracts/docker-compose.yml b/build-contracts/docker-compose.yml index 9d6f080..9356e24 100644 --- a/build-contracts/docker-compose.yml +++ b/build-contracts/docker-compose.yml @@ -163,7 +163,7 @@ services: consumedT=$$(kafkacat -b destination-kafka:9092 -C -K '=' -t topic2 -p 0 -e -f '%T\n' | tail -n 1) echo "$$producedT <> $$consumedT ?" && [ "$$producedT" == "$$consumedT" ] || exit 2 curl -s http://copy1:8080/metrics - # compression + # compression, BUT snappy here doesn't actually trigger https://github.com/Yolean/kafka-topics-copy/issues/4 so it must be flawed echo compression=gzip | kafkacat -b kafka:9092 -P -t topic1 -p 0 -K '=' -z gzip sleep 1 curl -s http://copy1:8080/metrics diff --git a/build.sh b/build.sh index 89cf1a5..9fb980d 100755 --- a/build.sh +++ b/build.sh @@ -23,3 +23,8 @@ docker build -f ./Dockerfile -t yolean/kafka-topics-copy:dev . build-contract docker tag yolean/kafka-topics-copy:dev yolean/kafka-topics-copy:latest docker push yolean/kafka-topics-copy:latest + +# Workaround for https://github.com/Yolean/kafka-topics-copy/issues/4 +# TODO add to build-contract +docker build -f ./Dockerfile --target runtime-plainjava -t yolean/kafka-topics-copy:plainjava . +docker push yolean/kafka-topics-copy:plainjava