Search code examples
windowsdockerdockerfilecontainersconan

How to install applications on a windows docker container?


I'm trying to create a Docker container based on the abrarov/msvc-2019 (windows based) image and I need to install additional programs such as Conan.

In the Dockerfile, what do I need to write in it to be able to install Conan? I can't just use something like "apt install" since Windows doesn't support anything of the sort. I can't find anything online about this.

I tried downloading the .exe installer locally and copy it inside the container, and then run the .exe during the building of the image. Something like this :

COPY conan-win-32_1_33_0.exe C:\\
RUN conan-win-32_1_33_0.exe;

But the image doesn't finish building and it's just stuck in the RUN part.


Solution

  • The most recommended way is using pip:

    pip install conan
    

    Another official ways are listed on download page. But as you listed, Windows installer is the another way.

    For Windows you still can try Chocolatey, but it's not maintained by Conan team.

    In the past we tried something similar and worked, a MSVC 15 Docker image with Conan. However, due Visual Studio license, we can't build images for distribution. You could fork the project and use it for your own propose.