I want to run the docker container in background permanently, But after running the following command it is immediate exited. Please help to fix this,
[root@localhost container]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ssh cont 35970fc28811 About an hour ago 536 MB
docker.io/centos 7 9f38484d220f 3 months ago 202 MB
[root@localhost container]#
[root@localhost container]#
[root@localhost container]#
[root@localhost container]# docker run -it -d --privileged -p 2222:22 --name con1 --hostname 'ssh1' 35970fc28811
5916fb131e6bc37712c0d1e6f86b503b72a98383c73ea80347a71b604d2a2112
[root@localhost container]#
[root@localhost container]#
[root@localhost container]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
[root@localhost container]#
[root@localhost container]#
[root@localhost container]#
[root@localhost container]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5916fb131e6b 35970fc28811 "/usr/sbin/sshd -D..." 10 seconds ago Exited (1) 9 seconds ago con1
[root@localhost container]#
[root@localhost container]#
[root@localhost container]#
[root@localhost container]#
[root@localhost container]#