Has anyone managed to get a Xojo built console application running in a Docker Container using Alpine ?
Alpine Linux is a Linux distribution built around musl libc and BusyBox. The image is only 5 MB in size and has access to a package repository that is much more complete than other BusyBox based images. This makes Alpine Linux a great image base for utilities and even production applications.
When using Ubuntu as the base image, everything works pretty easily. Alpine would be great since it's much more lightweight.
Just compare a dockerized cubeSQL : The Image size when using Ubuntu is 63MB, whereas with Alpine it's only 9MB.
So for Ubuntu, it only takes to add a couple of required Libraries:
#BASE IMAGE FROM ubuntu:18.04 #INSTALL REQUIRED LIBRARIES ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && apt-get install -y libunwind8 libglib2.0
Alpine is quite different... since it's so lightweight, it seems that quite some more has to be installed. And it uses a different
glibc variant (
musl libc), which doesn't seem to work with running Xojo built apps.
gcompat packages give even more errors (that's why it's commented out) than another popular glibc library.
Here is what I've tried - but it still doesn't work because of some glibc issues...:
#BASE IMAGE FROM alpine:3.9.4 RUN apk update && apk add libstdc++ \ # libc6-compat \ # gcompat \ libunwind \ glib \ curl RUN cd /tmp && \ curl -L -o /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \ curl -L -O https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.29-r0/glibc-2.29-r0.apk && \ curl -L -O https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.29-r0/glibc-bin-2.29-r0.apk && \ apk add glibc-2.29-r0.apk \ glibc-bin-2.29-r0.apk && \ rm /tmp/glibc-2.29-r0.apk && \ rm /tmp/glibc-bin-2.29-r0.apk RUN cd /tmp && \ curl -L -O https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.29-r0/glibc-i18n-2.29-r0.apk && \ apk add glibc-i18n-2.29-r0.apk && \ rm /tmp/glibc-i18n-2.29-r0.apk && \ /usr/glibc-compat/bin/localedef -i en_US -f UTF-8 en_US.UTF-8 ADD / /app/ EXPOSE 4224 WORKDIR /app CMD /app/aloe-express-demo
This still complains about
"symbols not found" (isinf, mallinfo, __isnan)...
So for now it seems that I will continue to experiment with Ubuntu... but I'd love to use Alpine because of it's security and lightweight size.
If anyone gets a Xojo built application running with Alpine Linux - please share how this can be done :)