Skip to content
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

Building docker generates error related to cairo.h #1

Open
aishniparab opened this issue Dec 9, 2024 · 0 comments
Open

Building docker generates error related to cairo.h #1

aishniparab opened this issue Dec 9, 2024 · 0 comments

Comments

@aishniparab
Copy link

Running docker build . generated the folllwing error:

20.72   creating build/temp.linux-x86_64-cpython-310/tmp/tmpojsveprv/ManimPango-0.5.0/manimpango
20.72   x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/tmp/tmpcdy30dsc/.venv/include -I/usr/include/python3.10 -c /tmp/tmpojsveprv/ManimPango-0.5.0/manimpango/cmanimpango.c -o build/temp.linux-x86_64-cpython-310/tmp/tmpojsveprv/ManimPango-0.5.0/manimpango/cmanimpango.o
20.72   /tmp/tmpojsveprv/ManimPango-0.5.0/manimpango/cmanimpango.c:1245:10: fatal error: cairo.h: No such file or directory
20.72    1245 | #include "cairo.h"
20.72         |          ^~~~~~~~~
20.72   compilation terminated.
20.72   error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
20.72   
20.72 
20.72   at .local/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/installation/chef.py:164 in _prepare
20.73       160│ 
20.73       161│                 error = ChefBuildError("\n\n".join(message_parts))
20.73       162│ 
20.73       163│             if error is not None:
20.73     → 164│                 raise error from None
20.73       165│ 
20.73       166│             return path
20.73       167│ 
20.73       168│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:
20.73 
20.73 Note: This error originates from the build backend, and is likely not a problem with poetry but with manimpango (0.5.0) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "manimpango (==0.5.0)"'.
20.73 
------
Dockerfile:22

I fixed this by changing the Dockerfile:


MAINTAINER McCoy "Hoss" Becker <[email protected]>

RUN apt-get update && apt-get install -y --no-install-recommends \
    virtualenv \
    curl \
    pipx \
    pkg-config \
    libcairo2-dev \
    libpango1.0-dev \
    libpangocairo-1.0-0 \
    libgirepository1.0-dev \
    gir1.2-pango-1.0 \
    python3-dev \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

RUN curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin

RUN groupadd -g 1001 wizard
RUN useradd -rm -d /home/wizard -s /bin/bash -g wizard -G sudo -u 1001 wizard
USER wizard
WORKDIR /home/wizard
RUN pipx ensurepath
RUN pipx install poetry
SHELL ["/bin/bash", "-l", "-c"]
ADD . /home/wizard
RUN poetry install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant