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

feat: Switch base image to debian from alpine. #1081

Closed
wants to merge 1 commit into from

Conversation

simar7
Copy link
Member

@simar7 simar7 commented Oct 14, 2021

This fixes the issue with not being able to run OPA/wasmas a rego runtime target.

The issue:

go: downloading github.com/bytecodealliance/wasmtime-go v0.30.0
go: downloading github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb
# github.com/bytecodealliance/wasmtime-go
/usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/bytecodealliance/[email protected]/build/linux-x86_64/libwasmtime.a(std-008055cc7d873802.std.cf1c8f7e-cgu.0.rcgu.o): in function `std::sys::unix::net::on_resolver_failure':
/rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b//library/std/src/sys/unix/net.rs:450: undefined reference to `__res_init'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:26: dist/tracee-rules] Error 2
make: *** [Makefile:43: dist/tracee-rules] Error 2
make[1]: Leaving directory '/tracee/tracee-rules'
The command '/bin/sh -c make' returned a non-zero code: 2
make: *** [Makefile:59: docker] Error 2

This is due to the issue: bytecodealliance/wasmtime-go#21
More conversation: https://openpolicyagent.slack.com/archives/C01V5E6LQN7/p1634084728014500

The alternate idea to use alpine base image + prop. libc (https://github.com/sgerrand/alpine-pkg-glibc) does not work and runs into the same issue. Therefore I went ahead with this approach.

Signed-off-by: Simar [email protected]

This fixes the issue with not being able to run OPA/wasm
as a rego runtime target.

Signed-off-by: Simar <[email protected]>
@simar7 simar7 self-assigned this Oct 14, 2021
@yanivagman
Copy link
Collaborator

I understand the reasons you wrote for moving from alpine to debian.
Can you please have a look at #335 and share your thoghts about it?

@simar7
Copy link
Member Author

simar7 commented Oct 18, 2021

I understand the reasons you wrote for moving from alpine to debian.
Can you please have a look at #335 and share your thoghts about it?

I understand the motivation with that PR was to reduce size and the size with this change look as follows:

tracee-alpine-slim   47.9MB

tracee-alpine-fat  360MB

tracee-debian-slim   151MB

tracee-debian-fat 1.28GB

It's quite a bit of increase but to guarantee functionality and eventually better performance as discussed previously (using WASM Rego runtime). But for this reason the departure from alpine is required, unless we can find a want to maintain a fork/build of wasmtime-go for musl/alpine.

Besides using debian as a base image, are there other options we could explore for reducing size (smaller than what we have with debian?)

@yanivagman
Copy link
Collaborator

Reducing size was not the only reason for this change.
Alpine images have a much smaller attack surface, which is also an important consideration.

I think this issue should be handled by the wasmtime project, and not by us introducing new dependencies to tracee (using glibc in that case).

@itaysk
Copy link
Collaborator

itaysk commented Dec 7, 2021

If not by wasmtime than by us compiling and vendoring it (if we decide to go all in on wasm)

I'm in favor of closing this one

@itaysk itaysk closed this Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants