Docker exited with code 1

Error: docker run with  Exited (1)

Cause: the CMD you run inside the docker exits with error

Solution: Check the error in docker log by these steps:

1. sudo docker ps -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f4c94eb133b4 dockername:latest “httpd”  55 seconds ago  Exited (1) 54 seconds ago0.0.0.0:80->80/tcp webserver

2. sudo docker logs CONTAINER_ID

Docker exited with code 1