Hossein Vatani Hossein Vatani - 2 months ago 13x
Linux Question

i could not run myself docker image which one i created

I created a tar file of live centOS with:

tar --numeric-owner \
--exclude=/proc \
--exclude=/sys \
--exclude=/mnt \
--exclude=/var/cache \
--exclude=/usr/share/doc \
--exclude=/tmp \
--exclude=/var/log \
-zcvf /mnt/rhel7-base.tar.gz /

and then run
cat rhel7-base.tar.gz | docker import - rhel7/01

to load it into docker. It finished without an error and I can find it with
docker images
command. Finally i tried to run it
docker run -i -t rhel7/01
(also without -i,-t switches), but nothing result

[root@vhp~]# docker run rhel7/01

I'm wondering if any one correct me, I want to make image of my OS.


Not 100% sure, but it seems that you're missing command for docker to execute inside your image, try:

[root@vhp~]# docker run -it rhel7/01 bash # this should drop you into bash inside docker container

Also you can check if container is running with docker ps -a