Skip to content

Commit ebc14fa

Browse files
committed
add dockerfile and makefile
1 parent fdc37ec commit ebc14fa

File tree

3 files changed

+87
-0
lines changed

3 files changed

+87
-0
lines changed

Dockerfile.rhel8

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.20-openshift-4.15 AS builder
2+
WORKDIR /go/src/github.com/openshift/api
3+
COPY . .
4+
ENV GO_PACKAGE github.com/openshift/api
5+
RUN make build --warn-undefined-variables
6+
7+
FROM registry.ci.openshift.org/ocp/4.14:base
8+
9+
# copy the built binaries to /usr/bin
10+
COPY --from=builder /go/src/github.com/openshift/api/render /usr/bin/
11+
COPY --from=builder /go/src/github.com/openshift/api/write-available-featuresets /usr/bin/
12+
13+
# this directory is used to produce rendered manifests that the installer applies (but does not maintain) in bootkube
14+
RUN mkdir -p /usr/share/bootkube/manifests/manifests
15+
COPY config/v1/*_config-operator_*.yaml /usr/share/bootkube/manifests/manifests
16+
COPY quota/v1/*.crd.yaml /usr/share/bootkube/manifests/manifests
17+
COPY security/v1/*.crd.yaml /usr/share/bootkube/manifests/manifests
18+
COPY securityinternal/v1/*.crd.yaml /usr/share/bootkube/manifests/manifests
19+
COPY authorization/v1/*.crd.yaml /usr/share/bootkube/manifests/manifests
20+
COPY operator/v1alpha1/0000_10_config-operator_01_imagecontentsourcepolicy.crd.yaml /usr/share/bootkube/manifests/manifests
21+
22+
# these are applied by the CVO
23+
COPY manifests /manifests
24+
# TODO copy these back when we're ready to make the switch from cluster-config-operator to here
25+
#COPY config/v1/*_config-operator_*.yaml /manifests
26+
#COPY quota/v1/*.crd.yaml /manifests
27+
#COPY security/v1/*.crd.yaml /manifests
28+
#COPY securityinternal/v1/*.crd.yaml /manifests
29+
#COPY authorization/v1/*.crd.yaml /manifests
30+
#COPY operator/v1alpha1/0000_10_config-operator_01_imagecontentsourcepolicy.crd.yaml /manifests
31+
#COPY operator/v1/0000_10_config-operator_*.yaml /manifests
32+
#COPY payload-command/empty-resources /manifests
33+
34+
# TODO uncomment after all the other "add a new image" steps are complete.
35+
#LABEL io.openshift.release.operator true

Makefile

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,47 @@ integration:
125125

126126
tests-vendor:
127127
make -C tests vendor
128+
129+
##################################
130+
#
131+
# BEGIN: Build binaries and images
132+
#
133+
##################################
134+
135+
.PHONY: build
136+
build: render write-available-featuresets
137+
138+
render:
139+
go build --mod=vendor -trimpath github.com/openshift/api/payload-command/cmd/render
140+
141+
write-available-featuresets:
142+
go build --mod=vendor -trimpath github.com/openshift/api/payload-command/cmd/write-available-featuresets
143+
144+
.PHONY: clean
145+
clean:
146+
rm render write-available-featuresets
147+
148+
VERSION ?= $(shell git describe --always --abbrev=7)
149+
MUTABLE_TAG ?= latest
150+
IMAGE ?= registry.ci.openshift.org/openshift/api
151+
152+
ifeq ($(shell command -v podman > /dev/null 2>&1 ; echo $$? ), 0)
153+
ENGINE=podman
154+
else ifeq ($(shell command -v docker > /dev/null 2>&1 ; echo $$? ), 0)
155+
ENGINE=docker
156+
endif
157+
158+
USE_DOCKER ?= 0
159+
ifeq ($(USE_DOCKER), 1)
160+
ENGINE=docker
161+
endif
162+
163+
.PHONY: images
164+
images:
165+
$(ENGINE) build -f Dockerfile.rhel8 -t "$(IMAGE):$(VERSION)" -t "$(IMAGE):$(MUTABLE_TAG)" ./
166+
167+
################################
168+
#
169+
# END: Build binaries and images
170+
#
171+
################################

manifests/image-references

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
kind: ImageStream
2+
apiVersion: image.openshift.io/v1
3+
spec:
4+
tags:
5+
- name: api
6+
from:
7+
kind: DockerImage
8+
name: quay.io/openshift/origin-api:v4.0

0 commit comments

Comments
 (0)