mikekelly / AgentK

An autoagentic AGI that is self-evolving and modular.
MIT License
875 stars 133 forks source link

docker build error #1

Closed sarancopper closed 2 months ago

sarancopper commented 2 months ago

I tried to build this repo in my windows machine. I got this error.

Reading package lists... Building dependency tree... Reading state information... E: Unable to locate package wget E: Unable to locate package curl E: Unable to locate package git E: Unable to locate package chromium-driver

Error log: image

sarancopper commented 2 months ago

I changed Dockerfile and got successful build

FROM python:3.9-slim-bullseye

RUN apt-get update && apt-get install -y \
    wget \
    curl \
    git \
    chromium-driver \
    ca-certificates \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .
ENTRYPOINT ["python", "agent_kernel.py"]
moffefei commented 2 months ago

I changed Dockerfile and got successful build

FROM python:3.9-slim-bullseye

RUN apt-get update && apt-get install -y \
    wget \
    curl \
    git \
    chromium-driver \
    ca-certificates \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .
ENTRYPOINT ["python", "agent_kernel.py"]

it works

mikekelly commented 2 months ago

Have you opened/modified apt-packages-list.txt on your host windows machine?

Each package name might be appended with a carriage return (\r) when the file is processed in a Windows environment, causing apt-get to fail to locate the packages.

We're trying to avoid hardcoding dependencies in the Dockerfile, a better fix for this might be to add RUN sed -i 's/\r$//' apt-packages-list.txt on the line above RUN xargs -a apt-packages-list.txt apt-get install -y - please could you try this and confirm it resolves the issue on windows

sarancopper commented 2 months ago

After i got error in docker, I just opened apt-packages-list.txt in visual studio code.

I will try this one RUN sed -i 's/\r$//' apt-packages-list.txt

cubic461 commented 2 months ago

i cannot make it work on windows. please help by making a install and run guide. thank you

AW-Creates commented 2 months ago

i cannot make it work on windows. please help by making a install and run guide. thank you I ran into an issue as well on windows. Follow this guide: https://www.youtube.com/watch?v=POGsJd2TQhk

Just be sure to edit the "Dockerfile" as well and replace it with this code while you're editing the "env.example" file:

FROM python:3.9-slim-bullseye

RUN apt-get update && apt-get install -y \ wget \ curl \ git \ chromium-driver \ ca-certificates \ && rm -rf /var/lib/apt/lists/*

WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt

COPY . . ENTRYPOINT ["python", "agent_kernel.py"]

sarancopper commented 2 months ago

Yes @mikekelly it works.