-
Notifications
You must be signed in to change notification settings - Fork 23
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
Use ubi instead of golang image for main Dockerbuild #548
Conversation
92bbd5a
to
583b589
Compare
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.
Looks good!
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.
@idlewis Wondering whether the operator binary from the new approach be compared with the current approach to ensure there isn't a significant difference
Dockerfile
Outdated
@@ -1,5 +1,9 @@ | |||
# Build the manager binary | |||
FROM golang:1.20 as builder | |||
FROM registry.access.redhat.com/ubi8 as builder |
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 registry.access.redhat.com/ubi8/ubi-minimal:latest
be used instead?
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.
@leochr I've pushed some updates to use ubi-minimal.
I've tested locally and have a pipeline build running now.
@leochr I have had a look around and I can't find a method to do a meaningful compare. One issue the above command did show is that I was using go 1.20.0 rather than 1.20.10. It seems the golang 1.20 docker image uses the 'latest' 1.20 version of go. However, the go download URL for 1.20 seems to specifically get 1.20.0. I haven't found an alternative download URL. This would mean we would have to update the docker file regularly to keep up with minor version updates. |
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.
@idlewis Thanks for the PR. Added a few comments.
Dockerfile
Outdated
FROM golang:1.20 as builder | ||
FROM registry.access.redhat.com/ubi8-minimal:latest as builder | ||
ARG GO_PLATFORM=amd64 | ||
env PATH=$PATH:/usr/local/go/bin |
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.
Should this be ENV
instead of env
?
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.
Yes. It seems to work with 'env' but that isnt' documented, so I've updated it.
Dockerfile
Outdated
ARG GO_PLATFORM=amd64 | ||
env PATH=$PATH:/usr/local/go/bin | ||
RUN microdnf install tar gzip | ||
RUN curl -L --output - "https://golang.org/dl/go1.20.10.linux-${GO_PLATFORM}.tar.gz" | tar -xz -C /usr/local/ |
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.
The Go version should be parameterized. Link it to the OnePipeline's config go-version
@idlewis The instructions at https://go.dev/doc/install state to use It doesn't seem like UBI image includes |
I've added the |
54c4b55
to
19d48fc
Compare
and fix env -> ENV And if no version is supplied, grab a default by parsing go.mod, in the same way that the go install script does
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.
@idlewis Looks good. Thank you
To deal with dockerhub rate limits
See WASdev/websphere-liberty-operator#270