简体   繁体   中英

docker exec or docker container exec

I noticed in the latest Docker CLI documentation that Docker CLI command list has expanded. If I used docker exec earlier to start executable inside container now I can also use docker container exec command.

docker container run command is similar to docker run , etc.

So which commands are preferrable now? Old syntax or new docker container syntax? Unfortunately I couldn't find any explanation in the docs.

Also what is the difference between docker container run and docker container create commands? And between docker container stop and docker container kill? The description and syntax are very similar.

Thanks.

As docker grew in features over time and new commands were added cli needed some redesign. You should use docker container exec to be compatible in the future, but docker exec is in fact an alias so until someone decided to deprecate it should also work. If you are interested, you can start reading about this change from this PR: https://github.com/moby/moby/pull/26025

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM