M
M
Mark Ivanych2017-07-25 23:49:22
Docker
Mark Ivanych, 2017-07-25 23:49:22

Docker and base images with different Linux distributions?

Hello,
I'm kind of uncomfortable that when building a project and using third-party images, each base image is with different Linux distributions.

FROM mysql:5.7 # Основано на debian:jessie
FROM sphinx  # Основано на Ubuntu

And so on, until you are ready to download all Linux. I understand that the core is one, but the environment is too diverse, I need one system.
He began to saw his images.
FROM debian:jessie
RUN apt-get update
RUN apt-get install nano
# Ok

FROM myproject_debian
RUN nano file 
# bash: nano: command not found

Apparently the base image settings are not being passed (
How will using a bunch of distributions affect performance if it is very important despite the convenience?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vladimir Zhurkin, 2017-07-26
@icCE

So the docker file is not for running programs the way you do.
It is for creating an environment, your new image.
How the dockerfile was created, we build the image with a script (dockerfile)
sudo docker build -t [name]
here is an example
https://www.8host.com/blog/avtomaticheskaya-sborka...
Now on the topic of performance. If you are seriously concerned about this and understand what and where to twist in linux, in order to achieve it. Create your images. Take as a basis the most minimal alpinelinux.org dist and do it for yourself. Everything else can be used, to quickly deploy, check . I always treat assemblies with some distrust, since there is no certainty that everything was done there as it should :)

T
Tyranron, 2017-07-26
@Tyranron

I understand that the core is one, but the environment is too diverse, I need one system.

What for?
Not at all.
You do not run distributions in containers, and not "Linux". Processes
run in containers . And if this is not a custom image, where a bunch of processes are stuffed with the supervisor of this whole thing, then the process starts alone . The performance issue is the performance of your process and how it works. If you run, for example, then what other files are there in the container - like a drum, because performance depends on itself, its configuration, and the resources of the machine, and not on whose feng shui the files are laid out, CentOS 'ovsky, or Debian'ovsky. mysqldmysqld

I
Ilya, 2018-11-29
@baltun7

strange architecture, why drag the entire environment behind you to launch just one process, why not separate these assemblies into some higher level, and for example, if ubunta is used in several images, then take it from the same place, and not for each image to push your entire distribution onto disk

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question