I'm unfortunately highly inexperienced with anything related to programming-- even describing me as a hobbyist would be generous-- and thought having a local instance of LocalAGI would be an interesting one-off to learn more about what my PC can do with LLMs with (relatively) minimal security risks. I was able to compile LocalAGI in Docker with some assistance, however kept running into some last-step issues running "docker compose up" to finalize and run the container centering around libmupdf.
Owing to my general inexperience (again, I apologize), here's what Docker spat back out at me with some coaxing:
"SYSTEM SPECIFICATIONS
OS: Windows 10 with Docker Desktop (WSL 2 - Ubuntu backend)
Go Version Required: 1.26.0
Docker Version: Latest (from docker compose output)
Node/Bun: Bun 1.3.14
Build Tool: Docker Compose v5.1.3
ISSUE SUMMARY
The LocalAGI Docker container fails to start with the following error:
panic: cannot load library: libmupdf.so: cannot open shared object file: No such file or directory
goroutine 1 [running]:
github.com/gen2brain/go-fitz.loadLibrary()
/go/pkg/mod/github.com/gen2brain/go-fitz@v1.24.15/purego_linux.go:18 +0x7a
github.com/gen2brain/go-fitz.init.0()
/go/pkg/mod/github.com/gen2brain/go-fitz@v1.24.15/fitz_nocgo.go:573 +0x17
Exit Code: 2
ROOT CAUSE
The go-fitz library (v1.24.15) in purego mode attempts to load libmupdf.so dynamically at runtime.
The library is not available in standard Linux Logical package repositories, making it impossible
to install via apt-get in Docker containers.
DEPENDENCY CHAIN
LocalAGI depends on:
- github.com/gen2brain/go-fitz v1.24.15 (for PDF processing)
- Requires: libmupdf.so (MuPDF library - shared object file)
- Uses: purego mode (pure Go without CGO)
- Loads library dynamically at initialization (fitz_nocgo.go:573)
DOCKER BUILD APPROACHES ATTEMPTED
-
Alpine Linux
- Status: FAILED
- Reason: mupdf-libs package not available or doesn't provide libmupdf.so
-
Ubuntu 24.04
- Status: FAILED
- Reason: libmupdf/libmupdf2 packages not found in repositories
-
Debian Bookworm
- Status: FAILED
- Reason: libmupdf packages not found in repositories
-
Ubuntu 22.04
- Status: FAILED
- Reason: libmupdf2 package not found in repositories
-
Building MuPDF from Source (Ubuntu 22.04 base)
- Status: FAILED
- Reason: Git clone of ArtifexSoftware/mupdf succeeded but make build failed
- Error: "make build=release shared=yes" did not complete successfully (exit code: 2)
-
CGO_ENABLED=1 with Static Linking
- Status: FAILED
- Reason: Go build failed during compilation
-
CGO_ENABLED=0 (Pure Go)
- Status: SUCCEEDED (Binary built: 57MB)
- Issue: Binary runs but fails at initialization when go-fitz tries to load libmupdf.so
FINAL WORKING DOCKERFILE
The Go binary successfully compiles when using:
- Base: golang:1.26-bookworm
- CGO_ENABLED=0
- Binary output: /tmp/localagi (57MB)
- Runtime base: debian:bookworm-slim or ubuntu:22.04
However, runtime fails because libmupdf.so cannot be found or installed."
I'm unsure where to go from here. Would it be possible to submit a prebuilt image to Docker hub or something?
Thank you
I'm unfortunately highly inexperienced with anything related to programming-- even describing me as a hobbyist would be generous-- and thought having a local instance of LocalAGI would be an interesting one-off to learn more about what my PC can do with LLMs with (relatively) minimal security risks. I was able to compile LocalAGI in Docker with some assistance, however kept running into some last-step issues running "docker compose up" to finalize and run the container centering around libmupdf.
Owing to my general inexperience (again, I apologize), here's what Docker spat back out at me with some coaxing:
"SYSTEM SPECIFICATIONS
OS: Windows 10 with Docker Desktop (WSL 2 - Ubuntu backend)
Go Version Required: 1.26.0
Docker Version: Latest (from docker compose output)
Node/Bun: Bun 1.3.14
Build Tool: Docker Compose v5.1.3
ISSUE SUMMARY
The LocalAGI Docker container fails to start with the following error:
panic: cannot load library: libmupdf.so: cannot open shared object file: No such file or directory
goroutine 1 [running]:
github.com/gen2brain/go-fitz.loadLibrary()
/go/pkg/mod/github.com/gen2brain/go-fitz@v1.24.15/purego_linux.go:18 +0x7a
github.com/gen2brain/go-fitz.init.0()
/go/pkg/mod/github.com/gen2brain/go-fitz@v1.24.15/fitz_nocgo.go:573 +0x17
Exit Code: 2
ROOT CAUSE
The go-fitz library (v1.24.15) in purego mode attempts to load libmupdf.so dynamically at runtime.
The library is not available in standard Linux Logical package repositories, making it impossible
to install via apt-get in Docker containers.
DEPENDENCY CHAIN
LocalAGI depends on:
DOCKER BUILD APPROACHES ATTEMPTED
Alpine Linux
Ubuntu 24.04
Debian Bookworm
Ubuntu 22.04
Building MuPDF from Source (Ubuntu 22.04 base)
CGO_ENABLED=1 with Static Linking
CGO_ENABLED=0 (Pure Go)
FINAL WORKING DOCKERFILE
The Go binary successfully compiles when using:
However, runtime fails because libmupdf.so cannot be found or installed."
I'm unsure where to go from here. Would it be possible to submit a prebuilt image to Docker hub or something?
Thank you