Skip to content

Commit

Permalink
Pushes a non-native build :plainjava as well
Browse files Browse the repository at this point in the history
workaround for #4
  • Loading branch information
solsson committed Mar 21, 2019
1 parent 6acd17d commit f012fdc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
17 changes: 14 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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."
Expand Down
2 changes: 1 addition & 1 deletion build-contracts/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit f012fdc

Please sign in to comment.