Register to Better Coder! It's free.
Enjoy the premium features and succeed at every job interview.

How many CMD instructions can be in a Dockerfile?

Experience Level: Senior
Tags: Docker

Answer

There can only be one CMD instruction in a Dockerfile. If you list more than one CMD then only the last CMD will take effect.

Comments

No Comments Yet.
Be the first to tell us what you think.
Docker instructions
Docker instructions

Are you learning Docker ? Try our test we designed to help you progress faster.

Test yourself