Skip to content
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

Conversation

christarazi
Copy link
Member

@christarazi christarazi commented Feb 12, 2021

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 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 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
@maintainer-s-little-helper maintainer-s-little-helper bot added this to In progress in 1.10.0 Feb 12, 2021
@christarazi christarazi force-pushed the pr/christarazi/fix-operator-build-race branch from c459bfe to 988ac14 Compare February 16, 2021 23:57
@christarazi christarazi marked this pull request as ready for review February 16, 2021 23:57
@christarazi christarazi requested a review from a team as a code owner February 16, 2021 23:57
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 christarazi force-pushed the pr/christarazi/fix-operator-build-race branch from 988ac14 to 0853ddd Compare February 16, 2021 23:59
@christarazi
Copy link
Member Author

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>
@pchaigno pchaigno removed their assignment Feb 17, 2021
@qmonnet qmonnet removed their assignment Feb 17, 2021
@christarazi christarazi reopened this Feb 17, 2021
@christarazi
Copy link
Member Author

Closed and reopened to trigger GH Actions, sorry for noise.

@aanm aanm merged commit fb39fd0 into cilium:master Feb 18, 2021
1.10.0 automation moved this from In progress to Done Feb 18, 2021
@christarazi christarazi deleted the pr/christarazi/fix-operator-build-race branch February 18, 2021 17:28
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.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

6 participants