Drifter
Drifter

Reputation: 281

Can I run docker containers linked with different OS

There is a datastorage, an mysql container, a php and a nginx. Is it possible to let these processes run on different oses? So one is on debian, the other on centos and so on?

Example

this one is debian

docker run --name sql -d buildsql

this one is centos

docker run --name php --linked sql:db -d buildphp

Upvotes: 1

Views: 127

Answers (1)

Adrian Mouat
Adrian Mouat

Reputation: 46480

Containers talk to each other over the network, so they are normally unaware of the OS being used by other containers, in exactly the same way that your browser doesn't really care about the OS of the webservers it talks to.

Most of the official images are based on Debian, so you quite often find your containers are all running Debian, but there's no need for this to be true. Some containers don't have an OS at all and just contain a binary that gets run when the container starts.

In short, there is no problem in using different OSs, unless you have some funky application specific problem with networking.

Upvotes: 1

Related Questions