cross compiling for linux x86_64 using bazel on osX











up vote
0
down vote

favorite












I am trying to build binaries for x86_64 linux box . I have my code on osX and using bazel to build the binaries.



Since i am new to bazel build system , i wanted to know what is the current practice to be able to build binaries for different architecture by running bazel on my host osX machine . Any pointer to code sample will be helpful ?



I have hear one strategy is to use some custom crosstool chain . How to figure this out for different architecture.



Also is it possible to run bazel build within a linux docker image with all the necessary compiler, tools and bazel installed within the docker image. This way i can share the docker image across environments and developers to we all have a uniform build system ? Not sure if such an image is already out there provided or is it even feasible to run bazel build within docker image while building code on my host os.



My end goal is to build these x86_64 linux binaries which will be deployed to using k8s . So after building this binary i do create a docker image with these binaries copied over and deploying those docker images using k8s. So what would be a good practice here ?










share|improve this question


























    up vote
    0
    down vote

    favorite












    I am trying to build binaries for x86_64 linux box . I have my code on osX and using bazel to build the binaries.



    Since i am new to bazel build system , i wanted to know what is the current practice to be able to build binaries for different architecture by running bazel on my host osX machine . Any pointer to code sample will be helpful ?



    I have hear one strategy is to use some custom crosstool chain . How to figure this out for different architecture.



    Also is it possible to run bazel build within a linux docker image with all the necessary compiler, tools and bazel installed within the docker image. This way i can share the docker image across environments and developers to we all have a uniform build system ? Not sure if such an image is already out there provided or is it even feasible to run bazel build within docker image while building code on my host os.



    My end goal is to build these x86_64 linux binaries which will be deployed to using k8s . So after building this binary i do create a docker image with these binaries copied over and deploying those docker images using k8s. So what would be a good practice here ?










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I am trying to build binaries for x86_64 linux box . I have my code on osX and using bazel to build the binaries.



      Since i am new to bazel build system , i wanted to know what is the current practice to be able to build binaries for different architecture by running bazel on my host osX machine . Any pointer to code sample will be helpful ?



      I have hear one strategy is to use some custom crosstool chain . How to figure this out for different architecture.



      Also is it possible to run bazel build within a linux docker image with all the necessary compiler, tools and bazel installed within the docker image. This way i can share the docker image across environments and developers to we all have a uniform build system ? Not sure if such an image is already out there provided or is it even feasible to run bazel build within docker image while building code on my host os.



      My end goal is to build these x86_64 linux binaries which will be deployed to using k8s . So after building this binary i do create a docker image with these binaries copied over and deploying those docker images using k8s. So what would be a good practice here ?










      share|improve this question













      I am trying to build binaries for x86_64 linux box . I have my code on osX and using bazel to build the binaries.



      Since i am new to bazel build system , i wanted to know what is the current practice to be able to build binaries for different architecture by running bazel on my host osX machine . Any pointer to code sample will be helpful ?



      I have hear one strategy is to use some custom crosstool chain . How to figure this out for different architecture.



      Also is it possible to run bazel build within a linux docker image with all the necessary compiler, tools and bazel installed within the docker image. This way i can share the docker image across environments and developers to we all have a uniform build system ? Not sure if such an image is already out there provided or is it even feasible to run bazel build within docker image while building code on my host os.



      My end goal is to build these x86_64 linux binaries which will be deployed to using k8s . So after building this binary i do create a docker image with these binaries copied over and deploying those docker images using k8s. So what would be a good practice here ?







      google-cloud-platform cross-platform x86-64 cross-compiling bazel






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 7 at 17:02









      user179156

      382518




      382518





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53194312%2fcross-compiling-for-linux-x86-64-using-bazel-on-osx%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53194312%2fcross-compiling-for-linux-x86-64-using-bazel-on-osx%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Academy of Television Arts & Sciences

          L'Équipe

          1995 France bombings