Getting "unable to execute 'gcc': No such file or directory"

I’m building a docker container that has some dependencies which require gcc.

My dockerfile contains the following line to install gcc:

RUN apk add --no-cache gcc musl-dev git python-dev hiredis-dev

However, while installing packages using pip, it fails with the above error.

Also - when I try building the docker container on my local machine, it works fine.

Has anybody come across this issue?

Are you running Pip inside the container? If so, that should work. Did you check the apk command was successful?

However, this looks like Alpine, which can be a bit more awkward to build. Can you replicate the problem locally, or is this just happening in the CircleCI environment?

Also, to debug if gcc is available, try which gcc in the container (locally or remotely) to see if it has been installed in a system path location.