Question: what is the difference between docker exec and docker attach?
Answer: Docker exec executes a new command / create a new process in the container's environment, while docker attach just connects the standard input/output/error of the main process(with PID 1) inside the container to corresponding standard input/output/error of current terminal(the terminal you are using to run the command) ...