From c1c21a550797f3bb038692da2960b6e7fe454c98 Mon Sep 17 00:00:00 2001 From: ychacon Date: Wed, 7 Jun 2023 14:42:33 +0200 Subject: [PATCH] Fix Dockerfile to add config file and certs Issue-ID: NONRTRIC-833 Signed-off-by: ychacon Change-Id: I83011e20c0d49850af4f6358c24df2bef0609c10 --- capifcore/Dockerfile | 11 +++++++++-- capifcore/configs/keycloak.yaml | 2 +- capifcore/internal/restclient/HTTPClient.go | 1 - 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/capifcore/Dockerfile b/capifcore/Dockerfile index ed97579..f564d3f 100644 --- a/capifcore/Dockerfile +++ b/capifcore/Dockerfile @@ -30,9 +30,16 @@ RUN go build -o /capifcore ## ## Deploy ## -FROM gcr.io/distroless/base-debian11 +FROM ubuntu WORKDIR / ## Copy from "build" stage COPY --from=build /capifcore . -USER nonroot:nonroot + +RUN mkdir /configs +RUN mkdir /certs + +COPY configs/keycloak.yaml /configs/keycloak.yaml +COPY certs/cert.pem /certs/cert.pem +COPY certs/key.pem /certs/key.pem + ENTRYPOINT ["/capifcore"] diff --git a/capifcore/configs/keycloak.yaml b/capifcore/configs/keycloak.yaml index 86b3905..3f05b42 100644 --- a/capifcore/configs/keycloak.yaml +++ b/capifcore/configs/keycloak.yaml @@ -17,7 +17,7 @@ # Keycloak configurations authorizationServer: - host: "localhost" + host: "keycloak" port: "8080" admin: user: "admin" diff --git a/capifcore/internal/restclient/HTTPClient.go b/capifcore/internal/restclient/HTTPClient.go index e9d3469..0dc2f24 100644 --- a/capifcore/internal/restclient/HTTPClient.go +++ b/capifcore/internal/restclient/HTTPClient.go @@ -71,7 +71,6 @@ func do(method string, url string, body []byte, header map[string]string, client if response, respErr := client.Do(req); respErr == nil { if isResponseSuccess(response.StatusCode) { - fmt.Printf("HTTP client:: response statuscode:: %v body:: %v\n", response.StatusCode, response.Body) defer response.Body.Close() // Read the response body -- 2.16.6