How to make docker image of host operating system

2019-01-14 11:17发布

I started using Docker and I can say, it is a great concept. Everything is going fine so far. I installed docker on ubuntu (my host operating system) , played with images from repository and made new images.

Question:

I want to make an image of the current(Host) operating system. How shall I achieve this using docker itself ? I am new to docker, so please ignore any silly things in my questions, if any.

标签: docker
1条回答
你好瞎i
2楼-- · 2019-01-14 12:00

I'm not sure to understand why you would want to do such a thing, but that is not the point of your question, so here's how to create a new Docker image from nothing:

If you can come up with a tar file of your current operating system, then you can create a new docker image of it with the docker import command.

cat my_host_filesystem.tar | docker import - myhost

where myhost is the docker image name you want and my_host_filesystem.tar the archive file of your OS file system.

Also take a look at Docker, start image from scratch from superuser and this answer from stackoverflow.

If you want to learn more about this, searching for docker "from scratch" is a good starting point.

查看更多
登录 后发表回答