From 2ce14ba78406cce8938881921ebebf826fe63bfa Mon Sep 17 00:00:00 2001 From: Georgi Kazakov Date: Tue, 14 Apr 2020 12:48:06 +0300 Subject: [PATCH] Fixes in building docker image --- Dockerfile | 13 ++++++++----- synth-publish.go | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index beb9117..66e0b4d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,19 +20,22 @@ RUN VERSION="version=$(git describe --tag --always 2> /dev/null)" \ && BUILDER="builder=$(go version)" \ && LDFLAGS="-s -w -X '"${BUILDINFO_PACKAGE}$VERSION"' -X '"${BUILDINFO_PACKAGE}$DATETIME"' -X '"${BUILDINFO_PACKAGE}$REPOSITORY"' -X '"${BUILDINFO_PACKAGE}$REVISION"' -X '"${BUILDINFO_PACKAGE}$BUILDER"'" \ && CGO_ENABLED=0 go build -mod=readonly -a -o /artifacts/${PROJECT} -ldflags="${LDFLAGS}" \ - && echo "Build flags: ${LDFLAGS}" + && echo "Build flags: ${LDFLAGS}" \ + #&& mv /${PROJECT} /${PROJECT}/ \ + && mv attributes.template /attributes.template \ + && mv systemAttributes.template /systemAttributes.template \ + && mv usageTickets.template /usageTickets.template + # Multi-stage build - copy certs and the binary into the image -FROM scratch +FROM alpine WORKDIR / COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ COPY --from=0 /artifacts/* / +COPY --from=0 /usr/local/bin/kubectl /usr/local/bin/kubectl COPY --from=0 /start.sh / COPY --from=0 /root/.kube/config / -CMD [ "/coco-synthetic-image-publication-monitor" ] - - ENV AWS_ADDRESS s3.amazonaws.com ENV BUCKET_ADDRESS com.ft.imagepublish.int EXPOSE 8080 diff --git a/synth-publish.go b/synth-publish.go index b3fe857..cb65f78 100644 --- a/synth-publish.go +++ b/synth-publish.go @@ -93,7 +93,7 @@ func main() { Timeout: 10 * time.Second, } http.HandleFunc("/__health", fthealth.Handler(timedHC)) - http.HandleFunc(httphandlers.GTGPath, httphandlers.NewGoodToGoHandler(gtg.StatusChecker(app.GTG))) + http.HandleFunc(httphandlers.BuildInfoPath, httphandlers.BuildInfoHandler) http.HandleFunc("/history", app.historyHandler) http.HandleFunc("/forcePublish", app.forcePublish) err := http.ListenAndServe(":8080", nil)