From 490897454911f96ec71e7d1a924f26a8927d67c6 Mon Sep 17 00:00:00 2001 From: Sabith KS Date: Fri, 3 Nov 2023 10:02:22 -0700 Subject: [PATCH 1/3] Keep the container image minimal --- Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 66908bce..9ad757b3 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 /bin/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 + +ENTRYPOINT [ "/bin/flagr" ] From 7d7d483ac1ae19838a24ba395f332518efe26cb8 Mon Sep 17 00:00:00 2001 From: Sabith KS Date: Fri, 3 Nov 2023 10:26:51 -0700 Subject: [PATCH 2/3] Review comment: Changing Integration test dockerfile --- integration_tests/Dockerfile-Integration-Test | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/integration_tests/Dockerfile-Integration-Test b/integration_tests/Dockerfile-Integration-Test index 23ad9979..aa1c072a 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 /bin/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 + +ENTRYPOINT [ "/bin/flagr" ] \ No newline at end of file From 9cf92fb8c60e6f60d52d12cfca54134f3f68b72b Mon Sep 17 00:00:00 2001 From: Sabith KS Date: Fri, 3 Nov 2023 11:10:03 -0700 Subject: [PATCH 3/3] Fix test with Entrypoint --- Dockerfile | 4 ++-- integration_tests/Dockerfile-Integration-Test | 4 ++-- integration_tests/docker-compose.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9ad757b3..b2395b76 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,7 @@ RUN make build FROM alpine -COPY --from=go_builder /go/src/github.com/openflagr/flagr/flagr /bin/flagr +COPY --from=go_builder /go/src/github.com/openflagr/flagr/flagr . ENV HOST=0.0.0.0 ENV PORT=18000 @@ -37,4 +37,4 @@ ADD --chown=appuser:appgroup ./buildscripts/demo_sqlite3.db /data/demo_sqlite3.d EXPOSE 18000 -ENTRYPOINT [ "/bin/flagr" ] +CMD "./flagr" diff --git a/integration_tests/Dockerfile-Integration-Test b/integration_tests/Dockerfile-Integration-Test index aa1c072a..20fd1f6b 100644 --- a/integration_tests/Dockerfile-Integration-Test +++ b/integration_tests/Dockerfile-Integration-Test @@ -6,7 +6,7 @@ RUN make build FROM alpine -COPY --from=go_builder /go/src/github.com/openflagr/flagr/flagr /bin/flagr +COPY --from=go_builder /go/src/github.com/openflagr/flagr/flagr . ENV HOST=0.0.0.0 ENV PORT=18000 @@ -16,4 +16,4 @@ RUN addgroup -S appgroup && adduser -S appuser -G appgroup USER appuser EXPOSE 18000 -ENTRYPOINT [ "/bin/flagr" ] \ No newline at end of file +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: