From 99e230826470773fdb8a37a9d0566ab279dc41e9 Mon Sep 17 00:00:00 2001 From: Jakub Al-Khalili Date: Tue, 9 Jul 2019 11:46:26 +0200 Subject: [PATCH] Improved Makefile and Dockerfile --- Dockerfile | 1 - Makefile | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 01cc30cc..79c1371e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,7 +42,6 @@ RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s RUN export GO111MODULE=auto RUN mkdir -p $GOPATH/src/github.com/jenkinsci/kubernetes-operator -ADD . $GOPATH/src/github.com/jenkinsci/kubernetes-operator WORKDIR $GOPATH/src/github.com/jenkinsci/kubernetes-operator RUN mkdir -p /home/builder diff --git a/Makefile b/Makefile index 64470b52..772f5ad8 100644 --- a/Makefile +++ b/Makefile @@ -416,19 +416,19 @@ endif @echo .PHONY: image -image: ## Create the docker image from the Dockerfile +image: ## Create the docker image from the Dockerfile. This image is used to build linux binary regardless of the system on the host @echo "+ $@" docker build --rm --force-rm --no-cache \ --build-arg GO_VERSION=$(GO_VERSION) \ --build-arg MINIKUBE_VERSION=$(MINIKUBE_VERSION) \ --build-arg OPERATOR_SDK_VERSION=$(OPERATOR_SDK_VERSION) \ - -t infrastructure/runner . + -t jenkins-operator/runner . .PHONY: indocker PWD := $(shell pwd) DOCKER_HOST_IP := $(shell minikube docker-env | grep DOCKER_HOST | cut -d '"' -f 2) MINIKUBE_IP := $(shell minikube ip) -indocker: image ## Run make in a docker container +indocker: minikube-run image ## Run make in a docker container @echo "+ $@" docker run --rm -it $(DOCKER_FLAGS) \ -v /var/run/docker.sock:/var/run/docker.sock \ @@ -437,4 +437,4 @@ indocker: image ## Run make in a docker container --mount type=bind,source=$(HOME)/.kube,target=/home/builder/.kube \ -e DOCKER_HOST=$(DOCKER_HOST_IP) \ -e MINIKUBE_IP=$(MINIKUBE_IP) \ - infrastructure/runner + jenkins-operator/runner