stevedbrown
stevedbrown

Reputation: 8934

Dockerfile option that defaults to background running (detached)

Is there an option you can specify in a Dockerfile that defaults containers built with it to run detached.

This would lead to the same outcome as the -d in:

docker run -d <imagename>

So that

docker run <imagename> 

would run detached by default.

Upvotes: 2

Views: 993

Answers (1)

spectre007
spectre007

Reputation: 1539

The purpose of Dockerfile is to build the image. How to run the image is controlled by "docker run" command. There is no option available in Dockerfile as per Docker documentation.

Upvotes: 10

Related Questions