Add Dockerfile

This commit is contained in:
Jian Qiu
2020-05-09 15:50:20 +08:00
parent fdbe918b1b
commit 897a280a9f
2 changed files with 19 additions and 0 deletions

9
Dockerfile Normal file
View File

@@ -0,0 +1,9 @@
FROM docker.io/openshift/origin-release:golang-1.13 AS builder
WORKDIR /go/src/github.com/open-cluster-management/work
COPY . .
ENV GO_PACKAGE github.com/open-cluster-management/nucleus
RUN make build --warn-undefined-variables
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.1-398
COPY --from=builder /go/src/github.com/open-cluster-management/nucleus/nucleus /

View File

@@ -2,6 +2,8 @@
all: build
.PHONY: all
IMAGE_REGISTRY?=quay.io
# Include the library makefile
include $(addprefix ./vendor/github.com/openshift/build-machinery-go/make/, \
golang.mk \
@@ -18,6 +20,14 @@ copy-crd:
update-all: copy-crd update
# This will call a macro called "build-image" which will generate image specific targets based on the parameters:
# $0 - macro name
# $1 - target suffix
# $2 - Dockerfile path
# $3 - context directory for image build
# It will generate target "image-$(1)" for builing the image an binding it as a prerequisite to target "images".
$(call build-image,nucleus,$(IMAGE_REGISTRY)/open-cluster-management/nucleus,./Dockerfile,.)
clean:
$(RM) ./nucleus
.PHONY: clean