gpt-engineer
gpt-engineer copied to clipboard
docker fails, missing gcc in base image
Expected Behavior
According to docker/README.md, for docker to build successfully.
Current Behavior
On a fresh clone of 3be1c37 (main):
$ git clone REPO && cd $_
$ docker-compose -f docker-compose.yml build
Building gpt-engineer
... 0.0s
=> [5/6] COPY docker/entrypoint.sh ./entrypoint.sh 0.0s
=> ERROR [6/6] RUN sudo pip install -e . 18.5s
------
> [6/6] RUN sudo pip install -e .:
...
#10 17.73 Building wheels for collected packages: gpt-engineer, tree-sitter
...
#10 18.01 Building wheel for tree-sitter (pyproject.toml): finished with status 'error'
#10 18.02 error: subprocess-exited-with-error
#10 18.02
#10 18.02 × Building wheel for tree-sitter (pyproject.toml) did not run successfully.
#10 18.02 │ exit code: 1
#10 18.02 ╰─> [16 lines of output]
...
#10 18.02 creating build/temp.linux-aarch64-cpython-310/tree_sitter/core/lib/src
#10 18.02 gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Itree_sitter/core/lib/include -Itree_sitter/core/lib/src -I/usr/local/include/python3.10 -c tree_sitter/binding.c -o build/temp.linux-aarch64-cpython-310/tree_sitter/binding.o -std=c99 -Wno-unused-variable
#10 18.02 error: command 'gcc' failed: No such file or directory
#10 18.02 [end of output]
#10 18.02
#10 18.02 note: This error originates from a subprocess, and is likely not a problem with pip.
#10 18.02 ERROR: Failed building wheel for tree-sitter
#10 18.02 Successfully built gpt-engineer
#10 18.02 Failed to build tree-sitter
#10 18.02 ERROR: Could not build wheels for tree-sitter, which is required to install pyproject.toml-based projects
#10 18.02
#10 18.02 [notice] A new release of pip is available: 23.0.1 -> 23.3.1
#10 18.02 [notice] To update, run: pip install --upgrade pip
------
executor failed running [/bin/sh -c sudo pip install -e .]: exit code: 1
ERROR: Service 'gpt-engineer' failed to build : Build failed
Solution
Notice how gcc is missing. A switch of the base-image solves it.
-FROM python:3.10-slim
+FROM python:3.10
Alternatives includes manually apt install gcc in Dockerfile or checking if project structure may be altered to not require it, or if other more suitable base image already exists.
Related to #746.