Skip to content

Unable to build docker container image for arm64 architectureΒ #4427

@maitreya-transidia

Description

@maitreya-transidia

Bug Description

I'm trying to build the most basic container image for arm64 on a Macbook Pro M4.

I'm using the example docker file in 'agents/examples'.

The only change I made is to get the Dockerfile to run the minimal example in 'agents/examples/minimal_worker.py'.

I get the following error when building the docker image:

$ podman build .

...


STEP 14/16: RUN python minimal_worker.py download-files
Traceback (most recent call last):
  File "/home/appuser/minimal_worker.py", line 5, in <module>
    from livekit.agents import AgentServer, JobContext, cli
  File "/home/appuser/.local/lib/python3.11/site-packages/livekit/agents/__init__.py", line 23, in <module>
    from . import cli, inference, ipc, llm, metrics, stt, tokenize, tts, utils, vad, voice
  File "/home/appuser/.local/lib/python3.11/site-packages/livekit/agents/cli/__init__.py", line 1, in <module>
    from .cli import AgentsConsole, run_app
  File "/home/appuser/.local/lib/python3.11/site-packages/livekit/agents/cli/cli.py", line 37, in <module>
    from livekit import rtc
  File "/home/appuser/.local/lib/python3.11/site-packages/livekit/rtc/__init__.py", line 41, in <module>
    from .audio_frame import AudioFrame
  File "/home/appuser/.local/lib/python3.11/site-packages/livekit/rtc/audio_frame.py", line 16, in <module>
    from ._ffi_client import FfiHandle
  File "/home/appuser/.local/lib/python3.11/site-packages/livekit/rtc/_ffi_client.py", line 61, in <module>
    ffi_lib = get_ffi_lib()
              ^^^^^^^^^^^^^
  File "/home/appuser/.local/lib/python3.11/site-packages/livekit/rtc/_ffi_client.py", line 58, in get_ffi_lib
    return ctypes.CDLL(str(path))
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/ctypes/__init__.py", line 376, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: libgobject-2.0.so.0: cannot open shared object file: No such file or directory
Error: building at STEP "RUN python minimal_worker.py download-files": while running runtime: exit status 1

I've tried the same process on an arm64 EC2 instance with the same results.

This used to work a few weeks ago just fine, but is now broken after I updated to the latest versions of livekit dependencies.

The process works fine when I'm building for x86_64.

Expected Behavior

This used to work to build for arm64 but has now broken. I can't figure out why this error shows up. I can build other arm64 images just fine.

Reproduction Steps

On a arm64 system:

1. Update the agents/examples/Dockerfile-example to run the minimal_agent.py instead of myagent.py
2. Run podman or docker build .
3. See the error that states:

OSError: libgobject-2.0.so.0: cannot open shared object file: No such file or directory

Operating System

macOS Tahoe 26.2 on MacBook Pro M4

Models Used

Silero

Package Versions

livekit                                            1.0.23
livekit-agents                                     1.3.10
livekit-api                                        1.1.0
livekit-blingfire                                  1.0.0
livekit-plugins-aws                                1.3.10
livekit-plugins-noise-cancellation                 0.2.5
livekit-plugins-silero                             1.3.10
livekit-plugins-turn-detector                      1.2.17
livekit-protocol                                   1.1.1

Session/Room/Call IDs

No response

Proposed Solution

Additional Context

No response

Screenshots and Recordings

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions