From fcc74ae8cb690c52ed202b157d198d8fa290d547 Mon Sep 17 00:00:00 2001 From: sks Date: Mon, 6 Nov 2023 23:56:49 -0800 Subject: [PATCH] Keep the container image minimal (#557) * Keep the container image minimal * Review comment: Changing Integration test dockerfile * Fix test with Entrypoint --- Dockerfile | 7 ++++++- integration_tests/Dockerfile-Integration-Test | 7 ++++++- integration_tests/docker-compose.yml | 4 ++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 66908bce..b2395b76 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,10 @@ RUN apk add --no-cache git make build-base ADD . . RUN make build +FROM alpine + +COPY --from=go_builder /go/src/github.com/openflagr/flagr/flagr . + ENV HOST=0.0.0.0 ENV PORT=18000 ENV FLAGR_DB_DBDRIVER=sqlite3 @@ -32,4 +36,5 @@ USER appuser ADD --chown=appuser:appgroup ./buildscripts/demo_sqlite3.db /data/demo_sqlite3.db EXPOSE 18000 -CMD ./flagr + +CMD "./flagr" diff --git a/integration_tests/Dockerfile-Integration-Test b/integration_tests/Dockerfile-Integration-Test index 23ad9979..20fd1f6b 100644 --- a/integration_tests/Dockerfile-Integration-Test +++ b/integration_tests/Dockerfile-Integration-Test @@ -4,6 +4,10 @@ RUN apk add --no-cache git make build-base ADD . . RUN make build +FROM alpine + +COPY --from=go_builder /go/src/github.com/openflagr/flagr/flagr . + ENV HOST=0.0.0.0 ENV PORT=18000 ENV FLAGR_DB_DBDRIVER=sqlite3 @@ -11,4 +15,5 @@ ENV FLAGR_RECORDER_ENABLED=false RUN addgroup -S appgroup && adduser -S appuser -G appgroup USER appuser EXPOSE 18000 -CMD ./flagr + +CMD "./flagr" \ No newline at end of file diff --git a/integration_tests/docker-compose.yml b/integration_tests/docker-compose.yml index 7b41ed08..16f0ceca 100644 --- a/integration_tests/docker-compose.yml +++ b/integration_tests/docker-compose.yml @@ -2,8 +2,8 @@ version: "3.6" networks: default: - external: - name: flagr_integration_tests + external: true + name: flagr_integration_tests services: mysql: