From 98e133a7be61721f22c974097ef5eac67c2092ed Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Fri, 15 May 2020 12:49:22 +0300 Subject: [PATCH] Push base image to Docker Hub --- .circleci/config.yml | 1 + Dockerfile.base | 10 ++++++++++ Makefile | 6 ++++++ deploy/bases/frontend/hpa.yaml | 2 +- 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 Dockerfile.base diff --git a/.circleci/config.yml b/.circleci/config.yml index 1110c2e..b39d739 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,6 +33,7 @@ jobs: echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin; echo $QUAY_PASS | docker login -u $QUAY_USER --password-stdin quay.io; make push-container; + make push-base; fi push-binary: diff --git a/Dockerfile.base b/Dockerfile.base new file mode 100644 index 0000000..6ff9489 --- /dev/null +++ b/Dockerfile.base @@ -0,0 +1,10 @@ +FROM golang:1.14 + +WORKDIR /workspace + +# copy modules manifests +COPY go.mod go.mod +COPY go.sum go.sum + +# cache modules +RUN go mod download diff --git a/Makefile b/Makefile index 6c7a480..1ad6bfa 100644 --- a/Makefile +++ b/Makefile @@ -33,6 +33,12 @@ build-charts: build-container: docker build -t $(DOCKER_IMAGE_NAME):$(VERSION) . +build-base: + docker build -f Dockerfile.base -t $(DOCKER_REPOSITORY)/podinfo-base:latest . + +push-base: build-base + docker push $(DOCKER_REPOSITORY)/podinfo-base:latest + test-container: @docker rm -f podinfo || true @docker run -dp 9898:9898 --name=podinfo $(DOCKER_IMAGE_NAME):$(VERSION) diff --git a/deploy/bases/frontend/hpa.yaml b/deploy/bases/frontend/hpa.yaml index 97709fc..53b343d 100644 --- a/deploy/bases/frontend/hpa.yaml +++ b/deploy/bases/frontend/hpa.yaml @@ -6,7 +6,7 @@ spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: backend + name: frontend minReplicas: 1 maxReplicas: 4 metrics: