mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-02-14 18:09:57 +00:00
Setup images build and github actions(without release).
Signed-off-by: xuezhaojun <zxue@redhat.com>
This commit is contained in:
24
build/Dockerfile.placement
Normal file
24
build/Dockerfile.placement
Normal 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}
|
||||
24
build/Dockerfile.registration
Normal file
24
build/Dockerfile.registration
Normal 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}
|
||||
24
build/Dockerfile.registration-operator
Normal file
24
build/Dockerfile.registration-operator
Normal 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
24
build/Dockerfile.work
Normal 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}
|
||||
Reference in New Issue
Block a user