From a11b6e7349e1bac271b32f7276eb10f71a76dc7a Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Wed, 23 Oct 2024 15:04:19 -0300 Subject: [PATCH 1/2] ci: shrink docker image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ```sh ͳ docker image ls ghcr.io/emqx/emqx-snowflake-proxy REPOSITORY TAG IMAGE ID CREATED SIZE ghcr.io/emqx/emqx-snowflake-proxy 2.0.0-slim0 5c4789a64014 5 seconds ago 365MB ghcr.io/emqx/emqx-snowflake-proxy 2.0.0 ee14dfc79f6a 41 minutes ago 919MB ``` --- Dockerfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c608650..c5cf2f5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,7 @@ -FROM clojure:latest +ARG BUILD_FROM=clojure:latest +ARG RUN_FROM=eclipse-temurin:8u422-b05-jre-noble + +FROM ${BUILD_FROM} AS builder RUN mkdir -p /usr/src/app WORKDIR /usr/src/app @@ -7,4 +10,10 @@ COPY . /usr/src/app RUN clojure -T:build uber && \ mv target/emqx-snowflake-proxy-*-standalone.jar app-standalone.jar +FROM ${RUN_FROM} AS runner + +COPY --from=builder /usr/src/app/app-standalone.jar /opt/proxy/app-standalone.jar + +WORKDIR /opt/proxy + CMD ["java", "-jar", "app-standalone.jar"] From 0001bff50ad9c25cad2ab5e6f15ab50e76fd610d Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Wed, 23 Oct 2024 15:06:57 -0300 Subject: [PATCH 2/2] ci: run tests on pull requests --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8cefe64..1fa90f4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,6 +1,6 @@ name: test -on: [push] +on: [push, pull_request] jobs: test: