-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add new Containerfile.tools to be used by openshift.release #15
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# | ||
# Copyright (c) 2023 Red Hat, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except | ||
# in compliance with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software distributed under the License | ||
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
# or implied. See the License for the specific language governing permissions and limitations under | ||
# the License. | ||
# | ||
|
||
FROM docker.io/golang:1.21 AS builder | ||
WORKDIR /go/src/github.com/openshift-kni/oran-o2ims | ||
COPY . . | ||
|
||
# Install ginkgo & mockgen. | ||
RUN go install github.com/onsi/ginkgo/v2/ginkgo@$(go list -f '{{.Version}}' -m github.com/onsi/ginkgo/v2) && \ | ||
go install go.uber.org/mock/[email protected] | ||
|
||
# Install golangci-lint. | ||
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2 && \ | ||
golangci-lint --version | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This way to install golangci-lint is a bit scary: it runs a shell script downloaded from GitHub that we don't really know what will do. Can we instead download the release artifact, verify that it hasn't changed since we checked the content and install it? For example:
The point there is that you are supposed to manually download the file, check that it is correct and then recalculate the sha256sum yourself. That way, if the file were to change (intentionally or by accident) the build will fail. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Definitely. |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use RHEL as the base image, like we do in Containerfile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can, for sure. I wanted to get away from having to install the Go 1.21 compiler and I saw that other operators in openshift-kni are also using this image. The preferred one would be the Go 1.21 version of registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.20-openshift-4.15, but there isn't one yet.