-
Notifications
You must be signed in to change notification settings - Fork 125
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
docker alpine based image #563
Conversation
Ill have a look when I am back from holiday, |
Agreed, my changing of the docker image to alpine was not ready. I apologize if that came across as a pull request, that was not my intention. That said, I am very interested in an alpine-based image for arm/v6, since I am running vzlogger on a pizero. So I may as well give this one a shot. The fix for this error message is:
This exposes the bug in the original code: What is returned is not const, since it is based on a variable, so it can change over time. Assigning that to a static shows that everytime the function is called the newest value is taken, so the proper fix is not returning a const. After this one, however, there are other error messages, so getting this to fully compile will require more changes. |
So quick check: @StefanSchoof : Do you want to continue pursuing this? I may have some time at some point, but don't want to promise anything right now. |
I may try it. But time may a issue and my c knowledge is very limited. So if you find time, I would be grateful. |
Turned out to be quite easy at the end. The second issue was the only other issue. See #564 |
Great, thanks @maxberger |
It is now building. Next step should be, to test if this image is working on an arm as expected. |
Thanks! Based on the discussions in #478 I realized there should probably be 2 types of test:
The second one is needed because other PRs such as #525 change the needed libraries, and have a potential to easily break things. In addition, someone needs to decide if alpine is what vzlogger wants to provide, or if you rather want to go with a pure buildroot (#486). I would recommend alpine because libary handling is easier there, but that's up to the vzlogger committers to decide. |
On my raspberry this image is running fine for several hours, without any problems. |
Here is the diff for the ldd test. I would recommend to add that, just to ensure we don't forget any libraries. It does not add additional dependencies or build time:
|
I also tried to run the included test inside docker. This is currently failing because some tests use tmpnam_r, which is not available on muslc, and therefore not on alpine. I'll see if there is an easy way to fix this. |
to ensure no libraries are missing, i would simply execute |
probably not a new issue, but seems worth noting: |
cmake is confused that it is running in different environments. The solution is to add "-B" to use a build directory. We could do this in the dockerfile. I'll try to create a patch for that as well :) |
I created another PR for test fixed with alpine: #566 . Once that is commited you can run:
This increased build time for me from about 20secs to about 110 secs (native build only, did not try on qemu/arm) |
And here is the patch for not-confusing cmake. Of course if may need to be adapted with the build test and make test from above.
|
Sure, that works as well:
|
I added a build arg to switch the tests on. This allows to run a To fix the issue with running |
Thanks. I like the idea of having the tests conditionally. I added some comments, but overall this is definitely what I will use. |
Thanks for the comments. |
Awesome! Looks really good to me! |
@StefanSchoof: |
6a08e1a
to
f073738
Compare
I will do an FUP pull then which changes "make" to "make -j $(nproc --all)"... |
would be ok to defer to a followup MR, |
Co-authored-by: Max Berger <[email protected]>
f073738
to
1aa5c79
Compare
thanks! |
In #545 the idea of an alpine based docker image come up.
In #560 a PR from @maxberger adding a alpine based image was added by mistake.
I took this commit from @maxberger and cleaned the file up.
Building with a amd64 image with
docker build --pull .
is working.But the arm build
docker build --pull --platform=linux/arm/v6 .
fails:Anyone an idea?
CC. @isarrider