Рет қаралды 321
Initialize a project with the files necessary to run the project in a container.
Docker Desktop provides the docker init CLI command. Run docker init in your project directory to be walked through the creation of the following files with sensible defaults for your project:
.dockerignore
Dockerfile
compose.yaml
README.Docker.md
If any of the files already exist, a prompt appears and provides a warning as well as giving you the option to overwrite all the files. If docker-compose.yaml already exists instead of compose.yaml, docker init can overwrite it, using docker-compose.yaml as the name for the Compose file.