What is the difference between docker exec and attach?
Docker exec
executes a new command / creates 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 the corresponding standard input/output/error of the current terminal(the terminal you are using to run the command).