This helps you build CentOS docker image from ISO files like CentOS-6.5-x86_64-bin-DVD1.iso.
The idea is from base-image-docker.
- Download iso file from centos vault
- Run script build.sh.
sudo sh ./build.sh CentOS-6.5-x86_64-bin-DVD1.iso
. - If step 2 is success, then you get
layer.tgz
file. - Create docker image.
sudo cat layer.tgz | docker import - centos6.5
. - Run docker:
sudo docker run --rm -ti centos6.5 /bin/bash
.
The build.sh
create tmnt
and target
directory.
tmnt
is used for temp mount. target
is an chroot filesystem. After success, You can delete both.
You also can play target
with chroot
command, like chroot target /bin/bash
.
Change chroot.sh
script, to choose RPM packages which you need.