pgh
pgh

Reputation: 213

Can Docker help build executable that work in different platform

I am new to docker and so my question could be very naive/stupid. The application that we use presently need to be compiled in different platform to make it work in desired platform i.e Linux and Window mainly. So we need to compile source code(C/C++) in different platform and give different executable to customer as per their OS . My question is 1. Is it possible with docker that i have one executable which work in all platform ? i.e i compile my source code in one platform e.g in Linux and ship executable with docker to run in Window platform

Thanks in advance

Upvotes: 11

Views: 3092

Answers (3)

Lie Ryan
Lie Ryan

Reputation: 64847

No it can't, docker is Linux only. To run docker in Windows, you need a virtual machine.

Unless you spend the time to wrap your installer script to install the virtual machine and all, you might as well just run a proper VM in a Virtual Box or VMWare of your choice. Even then your application experience on Windows will be second rate as it's not running natively.

Upvotes: 1

ISanych
ISanych

Reputation: 22680

Docker allows to run run the same container in any modern Linux distribution - you only need docker installed here. You cannot run these containers directly on Windows - you need to run virtual machine with Linux which will run docker container. That is what boot2docker is doing - running docker containers on Windows and Mac Os X in virtual machine. In some cases it is acceptable.

Upvotes: 2

Kenny Ostrom
Kenny Ostrom

Reputation: 5871

You still need to compile source code on different platforms. The point of the docker is to automate building and testing the code on every platform, so that you can just work on the code, and let it build and test on every platform.

You do have to set up the dockers and test scripts and get the code working cross-platform in the first place. But after that is done, you can basically not worry about any other platform unless you actually break it.

Upvotes: 2

Related Questions