Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom docker image for specific builds #567

Open
Forbinn opened this issue Jun 3, 2021 · 0 comments
Open

Custom docker image for specific builds #567

Forbinn opened this issue Jun 3, 2021 · 0 comments

Comments

@Forbinn
Copy link

Forbinn commented Jun 3, 2021

Hello,

tl;dr:
I would like to know if it is possible to specify a custom docker image for 1 specific build when you use the ConanMultiPackager class?

Basically I have a recipe that needs to be compiled for both Linux (using gcc) and Windows (using mingw). For that I, of course, use the ConanMultiPackager with dockers for the different compilation environment (different compiler version) and it works fine for Linux. Regarding Windows conan does not provide docker image for mingw so I created one but it seems that the ConanMultiPackager::docker_image ctor parameter is, well ... at ctor level so I cannot precise a docker image for Linux build and another one for mingw build.

Is there a way to do this? Or do I have to create multiple ConanMultiPackager for the different docker I want to use (So 1 per version of mingw)?

Example:

from cpt.packager import ConanMultiPackager

if __name__ == "__main__":
    builder = ConanMultiPackager(
                gcc_versions=["7", "8", "9", "10"],
                archs=["x86_64", "armv7hf", "armv8"],
                build_types=["Release", "Debug"],
                build_policy="missing",
                always_update_conan_in_docker=True,
                use_docker=True)

    builder.add_common_builds(pure_c=True)
    # Remove GCC 10 ARM V8 build because the docker image does not exists yet
    builder.remove_build_if(lambda build: build.settings["arch"] == "armv8" and build.settings["compiler.version"] == "10")

    # Here is what I would like to be able to do
    # Or maybe in a simpler way
    #builder.add(settings={"os": "Windows", "arch": "x86_64", "build_type": "Release", "compiler": "gcc", "compiler.version": 8},
    #            docker_image="mingw32")

    builder.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant