ananthakumaran / paisa

Paisa – Personal Finance Manager. https://paisa.fyi demo: https://demo.paisa.fyi
https://paisa.fyi
GNU Affero General Public License v3.0
2.4k stars 124 forks source link

Not working in alpine docker image #23

Closed swarajsomala closed 11 months ago

swarajsomala commented 11 months ago

I am trying to run a tool in an Alpine Docker image, but I am getting the error paisa: not found. If I change the Docker image to Ubuntu, the tool runs fine. I have included the contents of the Dockerfile below. I have also tried running the tool manually in the Docker container, but the error is same.

# Use an official Alpine Linux as a parent image
FROM alpine:latest

# Install required packages
RUN apk update && \
    apk add --no-cache \
    gcc \
    wget

# Download and install Paisa
RUN wget https://github.com/ananthakumaran/paisa/releases/download/v0.5.0/paisa-linux-amd64 -O /usr/local/bin/paisa && \
    chmod u+x /usr/local/bin/paisa

RUN paisa init

Error: image

ananthakumaran commented 11 months ago

This is because the paisa binary is not fully statically compiled, some parts are dynamically linked. I will look into it, but will take some time. For now, you can try to use any debian based distro.

/ # ldd paisa-linux-amd64
        /lib64/ld-linux-x86-64.so.2 (0x7f1907044000)
        libdl.so.2 => /lib64/ld-linux-x86-64.so.2 (0x7f1907044000)
Error loading shared library libresolv.so.2: No such file or directory (needed by paisa-linux-amd64)
        libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7f1907044000)
        libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f1907044000)
Error relocating paisa-linux-amd64: __vfprintf_chk: symbol not found
Error relocating paisa-linux-amd64: __memcpy_chk: symbol not found
Error relocating paisa-linux-amd64: __res_search: symbol not found
Error relocating paisa-linux-amd64: __memset_chk: symbol not found
Error relocating paisa-linux-amd64: __fprintf_chk: symbol not found
Error relocating paisa-linux-amd64: fcntl64: symbol not found
swarajsomala commented 11 months ago

sure.

The Dockerfile in the repository uses an Alpine image to run the Paisa application for deployment. I want to try using that because the Ubuntu-based image is around 500 MB in size, and I want to build a Docker image with less memory.

ananthakumaran commented 11 months ago

You can try something like https://hub.docker.com/r/bitnami/minideb Alpine is particularly problematic because they use musl instead of glibc

swarajsomala commented 11 months ago

I tried it but Minideb occupied more memory than ubuntu. That's fine I can continue with the ubuntu base image, will close the issue. Thank you.

image

ananthakumaran commented 11 months ago

@swarajsomala Alpine docker images are now available on docker hub https://hub.docker.com/r/ananthakumaran/paisa/tags