Answer the question
In order to leave comments, you need to log in
Docker - how to import an existing machine?
Started getting familiar with Docker. And this question arose:
Is it possible to create a docker image of a running server (LAMP)?
If so, I would like some fairly detailed instructions or where to read about it.
Google has not yet given any clear answers - it all comes down to either downloading the finished image - which is not interesting because it is not known what is in those images and how it is configured.
Or to create an image from scratch.
So is it still possible to import an already running system into an image?
Thanks in advance for your replies.
Answer the question
In order to leave comments, you need to log in
Docker-Compose will help you.
It will allow you to download a separate docker image (PHP, Nginx\Apache, *SQL) and customize them for yourself.
I think this article will help to understand https://www.digitalocean.com/community/tutorials/h...
But this one will show how to build docker-compose with PHP and MySQL https://docs.docker.com/compose/wordpress/
You need to copy your system to a separate folder, excluding directories such as /sys, /proc and /dev. After that, transfer the contents of this folder to tar and pipe it to the docker-import script.
Read up on how to create a baseimage. Also, for a better understanding of what is happening, you will need the skills to install linux manually, or at least an understanding of how the chroot works.
But in general this is not a true way, it's better to really create a new image from a pure
baseimage or use a ready-made one and import your configs into it. If you are afraid of bookmarks in other people's images, look for automated build images and look in the Dockerfile, good luck :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question