I wanna create a docker image from an ISO file. and I meet the same question like this iso to docker file
I did same operations with him , and I know it's wrong now.
now what i have is:
and I wanna know the detail operations to create a docker image from this ISO file.
if use VM, I hope i could get certainly operations. or if don't need VM, what should I do ?
I have searched many docs... like make a qcow2 from iso file, like debootstrap .. but these docs are not quite clearly and confused me a lot ...
I really wanna know detail operations, like this:
sudo mount -o loop CentOS-6.4-x86_64-minimal.iso /media/cdrom
sudo tar -C /media/cdrom -c . | docker import - flores314/centos2:new
although it is wrong, but it is clear.
If it is not clear, it will really really confused people like me ...
Thanks !!!
Finally, we can compress and import the image using Docker. Where IMAGENAME is the name you want to give the image and TAG is a tag for the image. When the process completes, you'll see an sha256 hash for the image printed out. And that's all there is to creating your own Docker images from downloaded ISOs.
Create a Docker image from an existing container: In this case, you start with an existing image, customize it with the changes you want, then build a new image from it. Use a Dockerfile: In this case, you use a file of instructions -- the Dockerfile -- to specify the base image and the changes you want to make to it.
You can create a new image by using docker command $docker build -f docker_filename . , It will first read the Dockerfile where the instructions are written and automatically build the image. The instruction in the Dockerfile contains the necessary commands to assemble an image.
docker import
can make your work easy.
I found a useful article for this https://medium.com/@SofianeHamlaoui/convert-iso-images-to-docker-images-4e1b1b637d75
Basically, converting an ISO to a docker container, is something you can't do verbatim. This is because one is a disk image, where the other is a complete container that also includes a filesystem.
It is possible though to create a new container, mount the iso and copy the contents into the FileSystem. I'm not sure if you're going to find anyone here who will write a list of commands that you should run to achieve this. If you start trying though and explain what you are doing and what problems you are running into, you will find that the people here are more than helpfull!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With