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

[BUG] Secure Code Agents Documentation Dockerfile not working #920

Open
mrinaldi2 opened this issue Mar 9, 2025 · 0 comments
Open

[BUG] Secure Code Agents Documentation Dockerfile not working #920

mrinaldi2 opened this issue Mar 9, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@mrinaldi2
Copy link

mrinaldi2 commented Mar 9, 2025

Describe the bug
The secure code agents example about docker didn't work for me The Dockerfile was not enough to build an image

Code to reproduce the error
Copy paste the Dockerfile and code from the last example and try to run. Didn't work

Error logs (if any)
Errors were multiple but mainly smolagents requires libraries that needs to build and the image were missing build ing tools like cargo, cmake and clang

Expected behavior
I would expect that if I copy paste some code especially about Docker, which by default is for easy reproducibility it should work out of the box

Packages version:
Run pip freeze | grep smolagents and paste it here.

Additional context
I am not the most expert in dockerize python so I have used some help from ChatGPT to get a final working image

Working Dockerfile

FROM python:3.10-bullseye

RUN apt-get update
RUN apt-get install -y --no-install-recommends \
        build-essential \
        cmake \
        python3-dev \
        llvm-dev \
        libclang-dev \
        clang && \
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
    export PATH="$HOME/.cargo/bin:$PATH"

ENV PATH="/root/.cargo/bin:${PATH}"

RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir smolagents && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

WORKDIR /app

USER nobody

CMD ["python", "-c", "print('Container ready')"]

maybe make sense to update the documentation thank you

@mrinaldi2 mrinaldi2 added the bug Something isn't working label Mar 9, 2025
@mrinaldi2 mrinaldi2 changed the title [BUG] [BUG] Secure Code Agents Documentation Dockerfile not working Mar 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant