-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
switch images to alpine #624
Conversation
Wow this is awesome work I could never get alpine images working due to inexperienced docker skills Have you been able to test these and the functionality of python/libre office etc? |
Just ran a quick run of all 3 docker files Ultra lite seems to be missing java |
From my tests (of the full image) everything works, except one thing; If I want to convert a pdf to word, I see in the docker logs: |
docker run --rm -it p 8080:8080 works for me on docker desktop |
(Meaning i am unable to run it and access 8080) |
yeah works via CMD for me as well, just find it odd that docker desktop UI doesnt work with it or let you define ports, so was wondering if this is something non standard |
I've never used EXPOSE in a Dockerfile since it does nothing (usefull): https://docs.docker.com/engine/reference/builder/#expose |
Something is defo off with the outputs when compared to old version seems its just loaded the PDF file bytes into .doc format not actual converting |
I've found the error |
Dockerfile-lite
Outdated
python3 && \ | ||
wget https://bootstrap.pypa.io/get-pip.py -qO - | python3 - --break-system-packages --no-cache-dir --upgrade && \ | ||
# uno unoconv and HTML | ||
pip install --break-system-packages --no-cache-dir --upgrade uno unoconv WeasyPrint && \ |
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.
I've added WeasyPrint since it seemed to be small, no idea what it does / if it is needed / adds more features
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.
maybe it should be mentioned in the versions guide
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.
Weasyprint is for html to pdf
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 I keep it?
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 i dont want to lose any functionality
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.
I ask because lite didn't included Weasyprint before
So right now the conversions are not happening in a way which i am happy with, it seems to throw everything onto single page, not sure why... Until then we wont be able to merge this. |
it seems to be a bug in libreoffice, so it will also affect debian/ubuntu when they will update in the future |
If it's the version and not general package can we pull the older version? |
v7.3.7.2-r0 and earlier of libreoffice works, everything after v7.5.5.2-r0 not, so the bug seems to be added with v7.4 or v7.5 |
https://packages.ubuntu.com/jammy/libreoffice currently the dokcer image uses v7.3 |
using alpine:3.17 instead of :latest makes it work for lite and normal, ultra lite can stay at latest, but 3.17 is two versions old... |
https://mirror1.hs-esslingen.de/pub/Mirrors/tdf/libreoffice/src/bugs-changelog-tag-libreoffice-7.6.4.1-release-7.6.4.1.log |
COPY scripts/init-without-ocr.sh /scripts/init-without-ocr.sh | ||
COPY pipeline /pipeline | ||
COPY build/libs/*.jar app.jar | ||
|
||
# Create user and group using Alpine's addgroup and adduser | ||
#RUN addgroup -g $PGID stirlingpdfgroup && \ | ||
# adduser -u $PUID -G stirlingpdfgroup -s /bin/sh -D stirlingpdfuser && \ |
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.
is there a reason why this is disabled? Can it be removed? Or should I try to get it working in PR after this is merged?
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.
Previously i had some issues with it and not had time to resolve
I would love to have correct permissions and user applied
Based on this and you using 3.19 is this PR now blocked on resolution of alpine updating its package manager? |
yes blocked until they fix libreoffice, but from what I know, they are fast in fixing this |
should now work, I will create a PR when a fixed libreoffice verion from outside edge can be used |
I had issues with calibre install requiring user prompts without it |
what do you mean? maybe try adding |
that didnt work for me, at least via ubuntu apt |
I talk about apk |
Okay lets remove wkhtmltopdf completly thats fine, ill merge your changes today or tomorrow and remove wkhtmltopdf as well as add |
was just rebuilding the dockerbaseFile (I think we can remove this base file now doesnt serve much purpose and move it all to dockerFile) I got Edit: fixed adding poppler to install list |
please retry |
https://github.com/Stirling-Tools/Stirling-PDF/actions/runs/7950256132/job/21702556824 gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DFFI_BUILDING=1 -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.11 -c src/c/_cffi_backend.c -o build/temp.linux-aarch64-cpython-311/src/c/_cffi_backend.o Any idea? works for other images |
just not lite |
try to add |
@Zoey2936 for running as non root user how would be best with volume mounting etc? I got stirling PDF running as none root user fine by using gosu/su-exec to switch from root to stirlingpdf user via entrypoint script My concern is that i volume mount folders such as /logs which the app (started by stirling user) doesnt have permission to write to as since its volume mounted it users the hosts permissions and often uses root. I can fix this by changing the permissions on host side but that would mess everyones installs and i wouldnt want to force people to change permissions on host level for every install So is running root then switch to new user the only way? (since i can use root user to set volume mounted folders to stirling user after startup) docker file
entrypoint.sh
|
yes the only way is to switch the user in the entrypoint |
@Zoey2936 Seems 3.19.1 has the single page libreoffice bug again regardless of repository used,
Any ideas? |
just wait... they updated to python 3.12 and their builder currently rebuilds all packages against python 3.12 |
Yeah first part seems fixed now thanks for bringing that to attention |
What di you mean? |
libreoffice-7.6.4.1-r3 |
So it doesn't work? |
I don't see any breaking chages in the last weeks https://gitlab.alpinelinux.org/alpine/aports/-/commits/master/community/libreoffice?ref_type=heads |
How odd..
To the APK installs in current docker file as it seems to require that, when I check |
Then i don't understand why it doesn't show :( |
What do you mean exactly with "doesn't show", does running |
Correct and the file itself isn't in the final docker build for some reason |
there is also an issue opened: https://gitlab.alpinelinux.org/alpine/aports/-/issues/16005 |
License Agreement for Contributions
By submitting this pull request, I acknowledge and agree that my contributions will be included in Stirling-PDF and that they can be relicensed in the future under MPL 2.0 (Mozilla Public License Version 2.0) license.
(This does not change the general open-source nature of Stirling-PDF, simply moving from one license to another license)