Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ds: Add CI Dockerfile #343

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions Dockerfile.ocp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# ---------- RHEL8 ----------
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.23-openshift-4.19 AS builder-rhel8

RUN mkdir /workdir
WORKDIR /workdir

COPY . .

ENV GOOS linux
# Support overriding target GOARCH during `make docker-build`
ARG goarch=amd64
ENV GOARCH=$goarch
ENV CGO_ENABLED 1
ENV GOFLAGS -mod=vendor

RUN mkdir /workdir/bin
RUN go build -o /workdir/bin/ovs ./cmd/plugin

# ---------- RHEL9 ----------
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.23-openshift-4.19 AS builder-rhel9

RUN mkdir /workdir
WORKDIR /workdir

COPY . .

ENV GOOS linux
# Support overriding target GOARCH during `make docker-build`
ARG goarch=amd64
ENV GOARCH=$goarch
ENV CGO_ENABLED 1
ENV GOFLAGS -mod=vendor

RUN mkdir /workdir/bin
RUN go build -o /workdir/bin/ovs ./cmd/plugin
RUN go build -o /workdir/bin/marker ./cmd/marker
RUN go build -o /workdir/bin/ovs-mirror-producer ./cmd/mirror-producer
RUN go build -o /workdir/bin/ovs-mirror-consumer ./cmd/mirror-consumer

# ---------- Run container ----------
FROM registry.ci.openshift.org/ocp/4.19:base-rhel9

COPY --from=builder-rhel9 /workdir/bin/* /

RUN mkdir /usr/bin/rhel9
COPY --from=builder-rhel9 /workdir/bin/ovs /usr/bin/rhel9
RUN mkdir /usr/bin/rhel8
COPY --from=builder-rhel8 /workdir/bin/ovs /usr/bin/rhel8

WORKDIR /

LABEL io.k8s.display-name="OVS CNI"
2 changes: 2 additions & 0 deletions OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ approvers:
- AlonaKaplan
- phoracek
- SchSeba
- zeeke
reviewers:
- AlonaKaplan
- EdDev
- phoracek
- rhrazdil
- SchSeba
- zeeke
Loading