I recently started using Docker, but sometimes I don't understand the relationship between containers and the OS.
I understand that the Docker mechanism shares the kernel with the host OS, and the container isolates only what is needed to run the application.
However, if you look at the Docker image, images such as Ubuntu and CentOS are also distributed.
The following points are not well understood as to what these images distribute.
-If i put Docker on MacOS, pull the Ubuntu image and launch the container, what is the OS running in the container?
In the above example, if I want to install some libraries in the container, can you use a package management tool for MacOS such as homebrew?
・ As another example, if Docker is installed on MacOS and a container is launched by pulling an image (such as python) that is not an OS, what is the OS running in the container?
I think the expression "OS running in a container" is a little strange for myself ...
Answer # 1
-If you put Docker on MacOS, pull the Ubuntu image and launch the container, what is the OS running in the container?
Linux (various distributions)
If Docker is the same CPU of Linux, the format of the executable file written in machine language is the same in different distributions, and it will work if you pass an appropriate dependency library.
You can't do that because MacOS is Unix.
So when I installed an application called Docker for Mac,
Using paravirtualization technology, simple high-speed Linux is operated as a virtual machine behind the scenes, and Docker is used in the virtual machine.
・ In the above example, if you want to install some libraries in the container, can you use package management tools for MacOS such as homebrew?
Homebrew is impossible.
Because it is a story inside the Linux of a virtual machine ...
For example, if you dropped the CentOS image, a package management tool called yum,
If you have dropped an Ubuntu image, you can use a package management tool called apt.
They only differ in whether yum and apt are in the directory where the path has passed.
・ As another example, if Docker is installed on MacOS and a container is launched by pulling a non-OS image (such as python), what will be the OS running in the container? ?
Repeat, any Linux distribution is a candidate.
Recently, Debian (including Ubuntu) is strong.
If you are interested, please check the site called Docker Hub.
In particular, all the famous images that are officially distributed include the Dockerfile used at the time of the build,
It is written in the form of
FROM distribution nameon the top line of the Dockerfile.
On the other hand, do not use an image that does not disclose the Dockerfile.
Answer # 2
Ubuntu and CentOS have the same kernel but different commands.
So, the Ubuntu and CentOS images have been reconfigured just like the command set, using the Linux kernel of the running environment as it is.
Non-OS image (e.g. python)
also actually runs on the Linux operating environment.
Since neither MacOS nor Windows is Linux, dedicated Linux is prepared in a virtual environment.
Answer # 3
Docker is a tool that relies on the Linux kernel, so it can't bedirectlyrun on macOS.
When running Docker on macOS, a Linux virtual machine is started up and run in it.
And distributions may vary from container to container, but the container kernel is always the Linux kernel.
- docker container can't start
- colorui = true does not work with git in docker container
- i want to import sql file into docker container (mysql) created on vagrant + virtualbox
- i want to connect to mysql from the app inside the docker container
- about porting the execution environment with docker
- ruby - docker container, volume rebuild
- cannot resolve name in docker container
- if you do rails db: create in docker container, you will get unknown mysql server host 'db' (-2)
- postgresql - want to use postico for db in docker container in local environment
- about docker run -it options
- The solution to the docker container call yum error
- Solve the problem that the docker container cannot ping the external network
- docker - i want to load the module of the outside container
- Method for turning jar package into docker container
- about writing to dockerfile
- Ubuntu Docker installation in vmware (container build)
- linux - about the environment in which the container operates
- about when inputting postgresql initial data with docker
- i want to ssh connect to the centos container on docker
- ruby - about docker (error occurred suddenly)
- python 3x - typeerror: 'method' object is not subscriptable
- python - you may need to restart the kernel to use updated packages error
- xcode - pod install [!] no `podfile 'found in the project directory
- android studio - emulator: dsound: could not initialize about the error message directsoundcapture
- android studio - unresolved reference comes out in kotlin
- vuejs - [vuetify] unable to locate target [data-app] i want to unit test to avoid warning
- django - oserror: [winerror 123] the file name, directory name, or volume label syntax is incorrect : '<frozen importlib_boot
- mysql startup failed [error] innodb: the innodb_system data file 'ibdata1' must be writable
- python 3x - import error "cannot import name '_imaging'"