Does a docker image build on MacOS can be deployed to another OS like Linux?
up vote
0
down vote
favorite
I just got started with docker. To my understanding, docker container runs a discrete process on the host machine and shares system resources of host machine too to that process, and as we know, codes building for Linux may not able to run on MacOS, and vice versa. My question is: can a docker image built on an OS platform can be deployed to another OS, like MacOS to Linux, or Ubuntu to CentOS?
If the question is NO, how come it only has one official mysql image on docker repositories, but not multiple like for Mac, for Ubuntu, for RHEL?
docker
New contributor
add a comment |
up vote
0
down vote
favorite
I just got started with docker. To my understanding, docker container runs a discrete process on the host machine and shares system resources of host machine too to that process, and as we know, codes building for Linux may not able to run on MacOS, and vice versa. My question is: can a docker image built on an OS platform can be deployed to another OS, like MacOS to Linux, or Ubuntu to CentOS?
If the question is NO, how come it only has one official mysql image on docker repositories, but not multiple like for Mac, for Ubuntu, for RHEL?
docker
New contributor
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I just got started with docker. To my understanding, docker container runs a discrete process on the host machine and shares system resources of host machine too to that process, and as we know, codes building for Linux may not able to run on MacOS, and vice versa. My question is: can a docker image built on an OS platform can be deployed to another OS, like MacOS to Linux, or Ubuntu to CentOS?
If the question is NO, how come it only has one official mysql image on docker repositories, but not multiple like for Mac, for Ubuntu, for RHEL?
docker
New contributor
I just got started with docker. To my understanding, docker container runs a discrete process on the host machine and shares system resources of host machine too to that process, and as we know, codes building for Linux may not able to run on MacOS, and vice versa. My question is: can a docker image built on an OS platform can be deployed to another OS, like MacOS to Linux, or Ubuntu to CentOS?
If the question is NO, how come it only has one official mysql image on docker repositories, but not multiple like for Mac, for Ubuntu, for RHEL?
docker
docker
New contributor
New contributor
edited Nov 5 at 4:08
Joel
1,3945719
1,3945719
New contributor
asked Nov 5 at 2:13
Kaibin Lin
11
11
New contributor
New contributor
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
Docker on mac works by creating a linux virtual machine. So a docker image built on Mac is in fact built on a linux virtual machine and can be freely exchanged with most other docker systems - including most docker on windows.
There is a windows version of dockers that is not linux based. Those images are not interchangeable.
add a comment |
up vote
0
down vote
Docker images are platform agnostic. The first thing a Dockerfile declares is what base image it pulls from, and that should determine the operating system under which the containers will run.
Using the MySQL 8 Dockerfile as an example:
https://github.com/docker-library/mysql/blob/223f0be1213bbd8647b841243a3114e8b34022f4/8.0/Dockerfile
FROM debian:stretch-slim
This means the image, and thus any containers started from it, will be based on Debian Linux...even if the host machine is MacOS.
I think you are technically wrong. There is linux docker and windows docker. (It is possible to run linux docker on windows or mac through virtual machine and this is in fact the most common way to run docker on windows.) However, windows docker images will not run on linux docker and vice-versa.
– emory
Nov 5 at 3:43
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Docker on mac works by creating a linux virtual machine. So a docker image built on Mac is in fact built on a linux virtual machine and can be freely exchanged with most other docker systems - including most docker on windows.
There is a windows version of dockers that is not linux based. Those images are not interchangeable.
add a comment |
up vote
1
down vote
Docker on mac works by creating a linux virtual machine. So a docker image built on Mac is in fact built on a linux virtual machine and can be freely exchanged with most other docker systems - including most docker on windows.
There is a windows version of dockers that is not linux based. Those images are not interchangeable.
add a comment |
up vote
1
down vote
up vote
1
down vote
Docker on mac works by creating a linux virtual machine. So a docker image built on Mac is in fact built on a linux virtual machine and can be freely exchanged with most other docker systems - including most docker on windows.
There is a windows version of dockers that is not linux based. Those images are not interchangeable.
Docker on mac works by creating a linux virtual machine. So a docker image built on Mac is in fact built on a linux virtual machine and can be freely exchanged with most other docker systems - including most docker on windows.
There is a windows version of dockers that is not linux based. Those images are not interchangeable.
answered Nov 5 at 3:46
emory
9,03812347
9,03812347
add a comment |
add a comment |
up vote
0
down vote
Docker images are platform agnostic. The first thing a Dockerfile declares is what base image it pulls from, and that should determine the operating system under which the containers will run.
Using the MySQL 8 Dockerfile as an example:
https://github.com/docker-library/mysql/blob/223f0be1213bbd8647b841243a3114e8b34022f4/8.0/Dockerfile
FROM debian:stretch-slim
This means the image, and thus any containers started from it, will be based on Debian Linux...even if the host machine is MacOS.
I think you are technically wrong. There is linux docker and windows docker. (It is possible to run linux docker on windows or mac through virtual machine and this is in fact the most common way to run docker on windows.) However, windows docker images will not run on linux docker and vice-versa.
– emory
Nov 5 at 3:43
add a comment |
up vote
0
down vote
Docker images are platform agnostic. The first thing a Dockerfile declares is what base image it pulls from, and that should determine the operating system under which the containers will run.
Using the MySQL 8 Dockerfile as an example:
https://github.com/docker-library/mysql/blob/223f0be1213bbd8647b841243a3114e8b34022f4/8.0/Dockerfile
FROM debian:stretch-slim
This means the image, and thus any containers started from it, will be based on Debian Linux...even if the host machine is MacOS.
I think you are technically wrong. There is linux docker and windows docker. (It is possible to run linux docker on windows or mac through virtual machine and this is in fact the most common way to run docker on windows.) However, windows docker images will not run on linux docker and vice-versa.
– emory
Nov 5 at 3:43
add a comment |
up vote
0
down vote
up vote
0
down vote
Docker images are platform agnostic. The first thing a Dockerfile declares is what base image it pulls from, and that should determine the operating system under which the containers will run.
Using the MySQL 8 Dockerfile as an example:
https://github.com/docker-library/mysql/blob/223f0be1213bbd8647b841243a3114e8b34022f4/8.0/Dockerfile
FROM debian:stretch-slim
This means the image, and thus any containers started from it, will be based on Debian Linux...even if the host machine is MacOS.
Docker images are platform agnostic. The first thing a Dockerfile declares is what base image it pulls from, and that should determine the operating system under which the containers will run.
Using the MySQL 8 Dockerfile as an example:
https://github.com/docker-library/mysql/blob/223f0be1213bbd8647b841243a3114e8b34022f4/8.0/Dockerfile
FROM debian:stretch-slim
This means the image, and thus any containers started from it, will be based on Debian Linux...even if the host machine is MacOS.
answered Nov 5 at 2:17
Mike
982516
982516
I think you are technically wrong. There is linux docker and windows docker. (It is possible to run linux docker on windows or mac through virtual machine and this is in fact the most common way to run docker on windows.) However, windows docker images will not run on linux docker and vice-versa.
– emory
Nov 5 at 3:43
add a comment |
I think you are technically wrong. There is linux docker and windows docker. (It is possible to run linux docker on windows or mac through virtual machine and this is in fact the most common way to run docker on windows.) However, windows docker images will not run on linux docker and vice-versa.
– emory
Nov 5 at 3:43
I think you are technically wrong. There is linux docker and windows docker. (It is possible to run linux docker on windows or mac through virtual machine and this is in fact the most common way to run docker on windows.) However, windows docker images will not run on linux docker and vice-versa.
– emory
Nov 5 at 3:43
I think you are technically wrong. There is linux docker and windows docker. (It is possible to run linux docker on windows or mac through virtual machine and this is in fact the most common way to run docker on windows.) However, windows docker images will not run on linux docker and vice-versa.
– emory
Nov 5 at 3:43
add a comment |
Kaibin Lin is a new contributor. Be nice, and check out our Code of Conduct.
Kaibin Lin is a new contributor. Be nice, and check out our Code of Conduct.
Kaibin Lin is a new contributor. Be nice, and check out our Code of Conduct.
Kaibin Lin is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53147454%2fdoes-a-docker-image-build-on-macos-can-be-deployed-to-another-os-like-linux%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password