Couldnt run docker container for a cross compiler

Hello everyone,

I am new to docker and I had this compiler toolchain with me which I would like to containerize so that I wont face much problem compiling on a new machine.

So structure of my folders in docker container is like this:-

-myapp

  • sysroots
  • Main
    – supportfolder
    – Makefile
  • Dockerfile

The Makefile folder has my cross-compilation toolchain say ppc-gcc and Makefile will call some path inside sysroots folder by …/sysroots//ppc-gcc main.c, but it shows error that ppc-gcc Not found but I checked container files, that ppc-gcc is present in the path.

Please help me resolve the problem.

Since you are using a relative path, the actual “workdir” could be different in the container. If you can, try using absolute path. You always know that in a container, so that is usually a good practice especialy when you are not sure what the workdir is. WORKDIR can be defined in the Dockerfile and also in the compose file as “working_dir”.

If it doesn’t help, you will have to share more details about how that files is copied into the image and why you think the reference should work.

Hi. Thanks for reply. It worked!!. Actually my ppc-gcc had a dependency referring to my one of my PC’s folder. I resolved it by first finding out dependency by ldd /ppc-gcc and uploading the required file along with it in the image.