Setup images build and github actions(without release).

Signed-off-by: xuezhaojun <zxue@redhat.com>
This commit is contained in:
xuezhaojun
2023-05-25 12:43:57 +08:00
parent a27dd5c4bf
commit 2fc048a096
20 changed files with 2226 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
FROM golang:1.19 AS builder
ARG OS=linux
ARG ARCH=amd64
WORKDIR /go/src/open-cluster-management.io/placement
COPY . .
ENV GO_PACKAGE open-cluster-management.io/placement
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
RUN GOOS=${OS} \
GOARCH=${ARCH} \
make build-placement
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
ENV USER_UID=10001
COPY --from=builder /go/src/open-cluster-management.io/placement/placement /
USER ${USER_UID}

View File

@@ -0,0 +1,24 @@
FROM golang:1.19 AS builder
ARG OS=linux
ARG ARCH=amd64
WORKDIR /go/src/open-cluster-management.io/registration
COPY . .
ENV GO_PACKAGE open-cluster-management.io/registration
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
RUN GOOS=${OS} \
GOARCH=${ARCH} \
make build-registration
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
ENV USER_UID=10001
COPY --from=builder /go/src/open-cluster-management.io/registration/registration /
USER ${USER_UID}

View File

@@ -0,0 +1,24 @@
FROM golang:1.19 AS builder
ARG OS=linux
ARG ARCH=amd64
WORKDIR /go/src/open-cluster-management.io/registration-operator
COPY . .
ENV GO_PACKAGE open-cluster-management.io/registration-operator
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
RUN GOOS=${OS} \
GOARCH=${ARCH} \
make build-registration-operator
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
ENV USER_UID=10001
COPY --from=builder /go/src/open-cluster-management.io/registration-operator/registration-operator /
USER ${USER_UID}

24
build/Dockerfile.work Normal file
View File

@@ -0,0 +1,24 @@
FROM golang:1.19 AS builder
ARG OS=linux
ARG ARCH=amd64
WORKDIR /go/src/open-cluster-management.io/work
COPY . .
ENV GO_PACKAGE open-cluster-management.io/work
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
RUN GOOS=${OS} \
GOARCH=${ARCH} \
make build-work
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
ENV USER_UID=10001
COPY --from=builder /go/src/open-cluster-management.io/work/work /
USER ${USER_UID}