What is the difference between docker exec and attach?

Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

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).

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x