linuxdockerdeploymentriscvself-contained

Deploying a cross-compilation toolchain in Docker


Working on a cross-compilation toolchain (for riscv architecture), using the Rocket-Chip generator project. This has a lot of dependencies, I developed everything on a Ubuntu 16.04 LTS machine. And I would like to deploy this in other machines holding an old Linux Debian (Linux 3.2) distribution.

Since Having lots of troubles with dependencies, I couldn't runs my tests properly natively on the machines.

Trying a Virtual Machine, was working but performance wasn't really fair enough.

My question is, is there any other methods to self-contain the toolchain with its sources and dependencies? I heard of Docker and that is used for that, but I wonder if this could be useful in my case?

Any ideas or directions are welcome! Thanks, Best Regards.


Solution

  • Yes, this is one scenario of docker.

    It's a cross-build tool as you mentioned. So you can put your source code to be built in host, e.g. /my_source_code_folder_host, then use following command to build the source code.

    docker run --rm -v /my_source_code_folder_host:/my_source_code_folder_container your_build_container_image
    

    For your_build_container_image, you need to set CMD or ENTRYPOINT in dockerfile and the value should be the built command of your toolchain, and it default build the sourcecode in my_source_code_folder_container, the output will then also be in my_source_code_folder_container.

    As the my_source_code_folder_container configured as a docker volume from the folder my_source_code_folder_host in host machine, so the output will also be seen in host.

    Currently, this solution widely used in some semiconductor company's CI team for daily cross-compile.