Skip to content
This repository was archived by the owner on Jun 26, 2024. It is now read-only.

Add Dockerfile #32

Merged
sbose78 merged 2 commits intoredhat-developer:masterfrom
sbose78:add-dockerfile
Jun 26, 2019
Merged

Add Dockerfile #32
sbose78 merged 2 commits intoredhat-developer:masterfrom
sbose78:add-dockerfile

Conversation

@sbose78
Copy link
Member

@sbose78 sbose78 commented Jun 25, 2019

  • Adding this Dockerfile until we have automated mirroring of builds happening from openshift CI
  • I plan to integrate this with quay.io/redhat-developer
  • Added make build

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign sbose78
You can assign the PR to them by writing /assign @sbose78 in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@@ -0,0 +1,83 @@
FROM centos:7 as build-tools
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't figured out how to use UBI here.

SecretKeyRef: sks,
}
evn := strings.ToUpper(strings.ReplaceAll(instance.Name, "-", "_")) + "_" + strings.ToUpper(strings.ReplaceAll(key, "-", "_"))
evn := strings.ToUpper(strings.Replace(instance.Name, "-", "_", -1)) + "_" + strings.ToUpper(strings.Replace(key, "-", "_", -1))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an unrelated change. Please use Go 1.12

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok! That explains it. Thanks.

ConfigMapKeyRef: cmks,
}
evn := strings.ToUpper(strings.ReplaceAll(instance.Name, "-", "_")) + "_" + strings.ToUpper(strings.ReplaceAll(key, "-", "_"))
evn := strings.ToUpper(strings.Replace(instance.Name, "-", "_", -1)) + "_" + strings.ToUpper(strings.Replace(key, "-", "_", -1))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an unrelated change. Please use Go 1.12

build: ./out/operator

./out/operator:
$(Q)CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build ${V_FLAG} -o ./out/operator cmd/manager/main.go No newline at end of file
Copy link
Contributor

@baijum baijum Jun 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

operator-sdk build produce docker image with UBI as the base image.
Earlier we used go build as there was no way to pass build flags. But that is fixed in SDK: operator-framework/operator-sdk#1435

Copy link
Contributor

@baijum baijum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a couple of comments. Dockerfile is not necessary.

@sbose78
Copy link
Member Author

sbose78 commented Jun 26, 2019

Ok, where could I find the operator image built off master?

@baijum
Copy link
Contributor

baijum commented Jun 26, 2019

Ok, where could I find the operator image built off master?

As soon as you run operator-sdk build <image> command, it produces the image. The image will be in the same system where this command was run.

But if the intent of this Makefile target is to use inside OpenShift CI like how we did it in DevConsole operator, then this will be required.
https://github.com/openshift/release/blob/872b1e09f6e5c3cca821b8c8bac90b54f9355573/ci-operator/config/redhat-developer/devconsole-operator/redhat-developer-devconsole-operator-master.yaml#L23

@baijum
Copy link
Contributor

baijum commented Jun 26, 2019

@sbose78 You can use the openshift-ci/Dockerfile.tools for the Dockerfile here. It has code Go 1.12 and other required tools.

@sbose78
Copy link
Member Author

sbose78 commented Jun 26, 2019

Eventually the intent is to build it on ci and mirror images to Quay.

But till we have that, I wish to setup master builds on Quay so that it could be used in the OperatorSource without having to locally build it and push it.

@sbose78
Copy link
Member Author

sbose78 commented Jun 26, 2019

( I will address the go1.12 comments )

@otaviof
Copy link
Member

otaviof commented Jun 26, 2019

If we really need a Dockerfile to be able to run this under OpenShift CI, we should find a automated way to extract the data from a operator-sdk build command output. By using automation we can mitigate the risk of deviating from what operator-sdk provides for the images we will be consuming in upstream.

@baijum
Copy link
Contributor

baijum commented Jun 26, 2019

@otaviof I have sent a PR to introduce building without OCI image: operator-framework/operator-sdk#1600

Copy link
Contributor

@baijum baijum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sbose78 sbose78 merged commit fa8bdae into redhat-developer:master Jun 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants