Skip to content

Commit

Permalink
add dockerfile and makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
deads2k committed Sep 18, 2023
1 parent fdc37ec commit ebc14fa
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 0 deletions.
35 changes: 35 additions & 0 deletions Dockerfile.rhel8
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.20-openshift-4.15 AS builder
WORKDIR /go/src/github.com/openshift/api
COPY . .
ENV GO_PACKAGE github.com/openshift/api
RUN make build --warn-undefined-variables

FROM registry.ci.openshift.org/ocp/4.14:base

# copy the built binaries to /usr/bin
COPY --from=builder /go/src/github.com/openshift/api/render /usr/bin/
COPY --from=builder /go/src/github.com/openshift/api/write-available-featuresets /usr/bin/

# this directory is used to produce rendered manifests that the installer applies (but does not maintain) in bootkube
RUN mkdir -p /usr/share/bootkube/manifests/manifests
COPY config/v1/*_config-operator_*.yaml /usr/share/bootkube/manifests/manifests
COPY quota/v1/*.crd.yaml /usr/share/bootkube/manifests/manifests
COPY security/v1/*.crd.yaml /usr/share/bootkube/manifests/manifests
COPY securityinternal/v1/*.crd.yaml /usr/share/bootkube/manifests/manifests
COPY authorization/v1/*.crd.yaml /usr/share/bootkube/manifests/manifests
COPY operator/v1alpha1/0000_10_config-operator_01_imagecontentsourcepolicy.crd.yaml /usr/share/bootkube/manifests/manifests

# these are applied by the CVO
COPY manifests /manifests
# TODO copy these back when we're ready to make the switch from cluster-config-operator to here
#COPY config/v1/*_config-operator_*.yaml /manifests
#COPY quota/v1/*.crd.yaml /manifests
#COPY security/v1/*.crd.yaml /manifests
#COPY securityinternal/v1/*.crd.yaml /manifests
#COPY authorization/v1/*.crd.yaml /manifests
#COPY operator/v1alpha1/0000_10_config-operator_01_imagecontentsourcepolicy.crd.yaml /manifests
#COPY operator/v1/0000_10_config-operator_*.yaml /manifests
#COPY payload-command/empty-resources /manifests

# TODO uncomment after all the other "add a new image" steps are complete.
#LABEL io.openshift.release.operator true
44 changes: 44 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,47 @@ integration:

tests-vendor:
make -C tests vendor

##################################
#
# BEGIN: Build binaries and images
#
##################################

.PHONY: build
build: render write-available-featuresets

render:
go build --mod=vendor -trimpath github.com/openshift/api/payload-command/cmd/render

write-available-featuresets:
go build --mod=vendor -trimpath github.com/openshift/api/payload-command/cmd/write-available-featuresets

.PHONY: clean
clean:
rm render write-available-featuresets

VERSION ?= $(shell git describe --always --abbrev=7)
MUTABLE_TAG ?= latest
IMAGE ?= registry.ci.openshift.org/openshift/api

ifeq ($(shell command -v podman > /dev/null 2>&1 ; echo $$? ), 0)
ENGINE=podman
else ifeq ($(shell command -v docker > /dev/null 2>&1 ; echo $$? ), 0)
ENGINE=docker
endif

USE_DOCKER ?= 0
ifeq ($(USE_DOCKER), 1)
ENGINE=docker
endif

.PHONY: images
images:
$(ENGINE) build -f Dockerfile.rhel8 -t "$(IMAGE):$(VERSION)" -t "$(IMAGE):$(MUTABLE_TAG)" ./

################################
#
# END: Build binaries and images
#
################################
8 changes: 8 additions & 0 deletions manifests/image-references
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
kind: ImageStream
apiVersion: image.openshift.io/v1
spec:
tags:
- name: api
from:
kind: DockerImage
name: quay.io/openshift/origin-api:v4.0

0 comments on commit ebc14fa

Please sign in to comment.