-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Makefile: Fix missing BASE_IMAGE in docker builds #14967
Merged
aanm
merged 2 commits into
cilium:master
from
christarazi:pr/christarazi/fix-operator-build-race
Feb 18, 2021
Merged
Makefile: Fix missing BASE_IMAGE in docker builds #14967
aanm
merged 2 commits into
cilium:master
from
christarazi:pr/christarazi/fix-operator-build-race
Feb 18, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
christarazi
added
release-note/misc
This PR makes changes that have no direct user impact.
area/build
Anything to do with the build, more general then area/CI
kind/regression
This functionality worked fine before, but was broken in a newer release of Cilium.
labels
Feb 12, 2021
maintainer-s-little-helper
bot
added
dont-merge/needs-release-note-label
The author needs to describe the release impact of these changes.
and removed
dont-merge/needs-release-note-label
The author needs to describe the release impact of these changes.
labels
Feb 12, 2021
christarazi
force-pushed
the
pr/christarazi/fix-operator-build-race
branch
from
February 16, 2021 23:57
c459bfe
to
988ac14
Compare
When compiling with race detection (`RACE=1`), the `BASE_IMAGE` must be passed for the Operator because race mode requires cgo which makes the resulting binary dynamically linked. The default `BASE_IMAGE` was set to `scratch` which means there is nothing in the resulting image's filesystem, other than the Operator binary. Example error: ``` $ docker run -it christarazi/operator-aws:latest /usr/bin/cilium-operator-aws standard_init_linux.go:219: exec user process caused: no such file or directory ``` The `BASE_IMAGE` was introduced in f4aa362 ("run with race detector"). However, the code to build the Operator changed in 7d67a82 ("Docker: Multi-arch & cross-compile build with docker buildx"), where the `BASE_IMAGE` should have been passed as a build argument. This is what the commit adds. Fixes: 7d67a82 Signed-off-by: Chris Tarazi <chris@isovalent.com>
christarazi
force-pushed
the
pr/christarazi/fix-operator-build-race
branch
from
February 16, 2021 23:59
988ac14
to
0853ddd
Compare
test-me-please |
This also calls out the caveat when building the Operator with race detection enabled. Signed-off-by: Chris Tarazi <chris@isovalent.com>
aanm
approved these changes
Feb 17, 2021
pchaigno
approved these changes
Feb 17, 2021
qmonnet
approved these changes
Feb 17, 2021
Closed and reopened to trigger GH Actions, sorry for noise. |
jrajahalme
approved these changes
Feb 18, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/build
Anything to do with the build, more general then area/CI
kind/regression
This functionality worked fine before, but was broken in a newer release of Cilium.
release-note/misc
This PR makes changes that have no direct user impact.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When compiling with race detection (
RACE=1
), theBASE_IMAGE
must bepassed for the Operator because race mode requires cgo which makes the
resulting binary dynamically linked. The default
BASE_IMAGE
was set toscratch
which means there is nothing in the resulting image'sfilesystem, other than the Operator binary.
Example error:
The
BASE_IMAGE
was introduced in f4aa362 ("run with race detector").However, the code to build the Operator changed in 7d67a82 ("Docker:
Multi-arch & cross-compile build with docker buildx"), where the
BASE_IMAGE
should have been passed as a build argument. This is whatthe commit adds.
Fixes: 7d67a82
Signed-off-by: Chris Tarazi chris@isovalent.com