From 061a2ce543bf4924ae06c66faebc5b4c75513349 Mon Sep 17 00:00:00 2001 From: Mateusz Kubaczyk Date: Fri, 8 May 2020 12:06:55 +0200 Subject: [PATCH] Fix docker building flow --- .circleci/config.yml | 4 ++-- dockerfile/dockerfile | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e90821f0..8532168b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -53,9 +53,9 @@ jobs: name: build docker images and push them to dockerhub command: | docker login -u $DOCKER_USER -p $DOCKER_PASS - docker build -t praqma/helmsman:$CIRCLE_TAG-helm-v2.16.7 --build-arg HELM_VERSION=v2.16.7 --build-arg HELM_DIFF_VERSION=master dockerfile/. --no-cache + docker build -t praqma/helmsman:$CIRCLE_TAG-helm-v2.16.7 --build-arg HELM_VERSION=v2.16.7 --build-arg HELM_DIFF_VERSION=master -f dockerfile/dockerfile --no-cache . docker push praqma/helmsman:$CIRCLE_TAG-helm-v2.16.7 - docker build -t praqma/helmsman:$CIRCLE_TAG-helm-v2.15.2 --build-arg HELM_VERSION=v2.15.2 --build-arg HELM_DIFF_VERSION=master dockerfile/. --no-cache + docker build -t praqma/helmsman:$CIRCLE_TAG-helm-v2.15.2 --build-arg HELM_VERSION=v2.15.2 --build-arg HELM_DIFF_VERSION=master -f dockerfile/dockerfile --no-cache . docker push praqma/helmsman:$CIRCLE_TAG-helm-v2.15.2 - run: diff --git a/dockerfile/dockerfile b/dockerfile/dockerfile index c1abc71f..eba12731 100644 --- a/dockerfile/dockerfile +++ b/dockerfile/dockerfile @@ -6,11 +6,12 @@ FROM golang:${GO_VERSION}-alpine3.10 as builder WORKDIR /go/src/ RUN apk --no-cache add make git dep -RUN git clone https://github.com/Praqma/helmsman.git +COPY . helmsman/ + +WORKDIR /go/src/helmsman # build a statically linked binary so that it works on stripped linux images such as alpine/busybox. -RUN cd helmsman \ - && LastTag=$(git describe --abbrev=0 --tags) \ +RUN LastTag=$(git describe --abbrev=0 --tags) \ && TAG=$LastTag-$(date +"%d%m%y") \ && LT_SHA=$(git rev-parse ${LastTag}^{}) \ && LC_SHA=$(git rev-parse HEAD) \