mirror of https://github.com/docker/docs.git
update docker init reference (#18795)
* update docker init for 4.26 Signed-off-by: Craig Osterhout <craig.osterhout@docker.com>
This commit is contained in:
parent
ccecc67e42
commit
3d0f7b6626
|
@ -70,6 +70,7 @@ This utility will walk you through creating the following files with sensible de
|
||||||
- .dockerignore
|
- .dockerignore
|
||||||
- Dockerfile
|
- Dockerfile
|
||||||
- compose.yaml
|
- compose.yaml
|
||||||
|
- README.Docker.md
|
||||||
|
|
||||||
Let's get started!
|
Let's get started!
|
||||||
|
|
||||||
|
@ -93,6 +94,7 @@ directory.
|
||||||
│ ├── Dockerfile
|
│ ├── Dockerfile
|
||||||
│ ├── package-lock.json
|
│ ├── package-lock.json
|
||||||
│ ├── package.json
|
│ ├── package.json
|
||||||
|
│ ├── README.Docker.md
|
||||||
│ └── README.md
|
│ └── README.md
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -105,6 +105,7 @@ directory.
|
||||||
│ ├── Dockerfile
|
│ ├── Dockerfile
|
||||||
│ ├── package-lock.json
|
│ ├── package-lock.json
|
||||||
│ ├── package.json
|
│ ├── package.json
|
||||||
|
│ ├── README.Docker.md
|
||||||
│ └── README.md
|
│ └── README.md
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,7 @@ This utility will walk you through creating the following files with sensible de
|
||||||
- .dockerignore
|
- .dockerignore
|
||||||
- Dockerfile
|
- Dockerfile
|
||||||
- compose.yaml
|
- compose.yaml
|
||||||
|
- README.Docker.md
|
||||||
|
|
||||||
Let's get started!
|
Let's get started!
|
||||||
|
|
||||||
|
@ -79,6 +80,7 @@ directory.
|
||||||
│ ├── .dockerignore
|
│ ├── .dockerignore
|
||||||
│ ├── compose.yaml
|
│ ├── compose.yaml
|
||||||
│ ├── Dockerfile
|
│ ├── Dockerfile
|
||||||
|
│ ├── README.Docker.md
|
||||||
│ └── README.md
|
│ └── README.md
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ You'll need to clone a new repository to get a sample application that includes
|
||||||
- .dockerignore
|
- .dockerignore
|
||||||
- Dockerfile
|
- Dockerfile
|
||||||
- compose.yaml
|
- compose.yaml
|
||||||
|
- README.Docker.md
|
||||||
|
|
||||||
Let's get started!
|
Let's get started!
|
||||||
|
|
||||||
|
@ -118,6 +119,7 @@ directory.
|
||||||
│ ├── .dockerignore
|
│ ├── .dockerignore
|
||||||
│ ├── compose.yaml
|
│ ├── compose.yaml
|
||||||
│ ├── Dockerfile
|
│ ├── Dockerfile
|
||||||
|
│ ├── README.Docker.md
|
||||||
│ └── README.md
|
│ └── README.md
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,7 @@ This utility will walk you through creating the following files with sensible de
|
||||||
- .dockerignore
|
- .dockerignore
|
||||||
- Dockerfile
|
- Dockerfile
|
||||||
- compose.yaml
|
- compose.yaml
|
||||||
|
- README.Docker.md
|
||||||
|
|
||||||
Let's get started!
|
Let's get started!
|
||||||
|
|
||||||
|
@ -70,11 +71,12 @@ Let's get started!
|
||||||
? What port does your server listen on? 8000
|
? What port does your server listen on? 8000
|
||||||
```
|
```
|
||||||
|
|
||||||
You should now have the following 3 new files in your `docker-rust-hello`
|
You should now have the following new files in your `docker-rust-hello`
|
||||||
directory:
|
directory:
|
||||||
- Dockerfile
|
- Dockerfile
|
||||||
- .dockerignore
|
- .dockerignore
|
||||||
- compose.yaml
|
- compose.yaml
|
||||||
|
- README.Docker.md
|
||||||
|
|
||||||
For building an image, only the Dockerfile is necessary. Open the Dockerfile
|
For building an image, only the Dockerfile is necessary. Open the Dockerfile
|
||||||
in your favorite IDE or text editor and see what it contains. To learn more
|
in your favorite IDE or text editor and see what it contains. To learn more
|
||||||
|
|
|
@ -86,6 +86,7 @@ For the sample application, you'll use a variation of the backend from the react
|
||||||
- .dockerignore
|
- .dockerignore
|
||||||
- Dockerfile
|
- Dockerfile
|
||||||
- compose.yaml
|
- compose.yaml
|
||||||
|
- README.Docker.md
|
||||||
|
|
||||||
Let's get started!
|
Let's get started!
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ long: |-
|
||||||
* .dockerignore
|
* .dockerignore
|
||||||
* Dockerfile
|
* Dockerfile
|
||||||
* compose.yaml
|
* 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 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.
|
||||||
|
|
||||||
|
@ -15,13 +16,14 @@ long: |-
|
||||||
>
|
>
|
||||||
> You can't recover overwritten files.
|
> You can't recover overwritten files.
|
||||||
> To back up an existing file before selecting to overwrite it, rename the file or copy it to another directory.
|
> To back up an existing file before selecting to overwrite it, rename the file or copy it to another directory.
|
||||||
{: .warning}
|
{ .warning }
|
||||||
|
|
||||||
After running `docker init`, you can choose one of the following templates:
|
After running `docker init`, you can choose one of the following templates:
|
||||||
|
|
||||||
* ASP.NET Core: Suitable for an ASP.NET Core application.
|
* ASP.NET Core: Suitable for an ASP.NET Core application.
|
||||||
* Go: Suitable for a Go server application.
|
* Go: Suitable for a Go server application.
|
||||||
* Node: Suitable for a Node server application.
|
* Node: Suitable for a Node server application.
|
||||||
|
* PHP with Apache: Suitable for a PHP web application.
|
||||||
* Python: Suitable for a Python server application.
|
* Python: Suitable for a Python server application.
|
||||||
* Rust: Suitable for a Rust server application.
|
* Rust: Suitable for a Rust server application.
|
||||||
* Other: General purpose starting point for containerizing your application.
|
* Other: General purpose starting point for containerizing your application.
|
||||||
|
@ -65,15 +67,17 @@ examples: |-
|
||||||
- .dockerignore
|
- .dockerignore
|
||||||
- Dockerfile
|
- Dockerfile
|
||||||
- compose.yaml
|
- compose.yaml
|
||||||
|
- README.Docker.md
|
||||||
|
|
||||||
Let's get started!
|
Let's get started!
|
||||||
|
|
||||||
? What application platform does your project use? [Use arrows to move, type to filter]
|
? What application platform does your project use? [Use arrows to move, type to filter]
|
||||||
> Go - (detected) suitable for a Go server application
|
> PHP with Apache - (detected) suitable for a PHP web application
|
||||||
ASP.NET Core - suitable for an ASP.NET Core application
|
Go - (detected) suitable for a Go server application
|
||||||
Python - suitable for a Python server application
|
Python - suitable for a Python server application
|
||||||
Node - suitable for a Node server application
|
Node - suitable for a Node server application
|
||||||
Rust - suitable for a Rust server application
|
Rust - suitable for a Rust server application
|
||||||
|
ASP.NET Core - suitable for an ASP.NET Core application
|
||||||
Other - general purpose starting point for containerizing your application
|
Other - general purpose starting point for containerizing your application
|
||||||
Don't see something you need? Let us know!
|
Don't see something you need? Let us know!
|
||||||
Quit
|
Quit
|
||||||
|
@ -92,6 +96,7 @@ examples: |-
|
||||||
CREATED: .dockerignore
|
CREATED: .dockerignore
|
||||||
CREATED: Dockerfile
|
CREATED: Dockerfile
|
||||||
CREATED: compose.yaml
|
CREATED: compose.yaml
|
||||||
|
CREATED: README.Docker.md
|
||||||
|
|
||||||
✔ Your Docker files are ready!
|
✔ Your Docker files are ready!
|
||||||
|
|
||||||
|
@ -100,6 +105,8 @@ examples: |-
|
||||||
When you're ready, start your application by running: docker compose up --build
|
When you're ready, start your application by running: docker compose up --build
|
||||||
|
|
||||||
Your application will be available at http://localhost:3333
|
Your application will be available at http://localhost:3333
|
||||||
|
|
||||||
|
Consult README.Docker.md for more information about using the generated files.
|
||||||
```
|
```
|
||||||
|
|
||||||
### Example of selecting Node
|
### Example of selecting Node
|
||||||
|
@ -118,6 +125,7 @@ examples: |-
|
||||||
CREATED: .dockerignore
|
CREATED: .dockerignore
|
||||||
CREATED: Dockerfile
|
CREATED: Dockerfile
|
||||||
CREATED: compose.yaml
|
CREATED: compose.yaml
|
||||||
|
CREATED: README.Docker.md
|
||||||
|
|
||||||
✔ Your Docker files are ready!
|
✔ Your Docker files are ready!
|
||||||
|
|
||||||
|
@ -126,6 +134,8 @@ examples: |-
|
||||||
When you're ready, start your application by running: docker compose up --build
|
When you're ready, start your application by running: docker compose up --build
|
||||||
|
|
||||||
Your application will be available at http://localhost:8000
|
Your application will be available at http://localhost:8000
|
||||||
|
|
||||||
|
Consult README.Docker.md for more information about using the generated files.
|
||||||
```
|
```
|
||||||
|
|
||||||
### Example of selecting Python
|
### Example of selecting Python
|
||||||
|
@ -141,6 +151,7 @@ examples: |-
|
||||||
CREATED: .dockerignore
|
CREATED: .dockerignore
|
||||||
CREATED: Dockerfile
|
CREATED: Dockerfile
|
||||||
CREATED: compose.yaml
|
CREATED: compose.yaml
|
||||||
|
CREATED: README.Docker.md
|
||||||
|
|
||||||
✔ Your Docker files are ready!
|
✔ Your Docker files are ready!
|
||||||
|
|
||||||
|
@ -149,6 +160,8 @@ examples: |-
|
||||||
When you're ready, start your application by running: docker compose up --build
|
When you're ready, start your application by running: docker compose up --build
|
||||||
|
|
||||||
Your application will be available at http://localhost:8000
|
Your application will be available at http://localhost:8000
|
||||||
|
|
||||||
|
Consult README.Docker.md for more information about using the generated files.
|
||||||
```
|
```
|
||||||
|
|
||||||
### Example of selecting Rust
|
### Example of selecting Rust
|
||||||
|
@ -163,6 +176,7 @@ examples: |-
|
||||||
CREATED: .dockerignore
|
CREATED: .dockerignore
|
||||||
CREATED: Dockerfile
|
CREATED: Dockerfile
|
||||||
CREATED: compose.yaml
|
CREATED: compose.yaml
|
||||||
|
CREATED: README.Docker.md
|
||||||
|
|
||||||
✔ Your Docker files are ready!
|
✔ Your Docker files are ready!
|
||||||
|
|
||||||
|
@ -171,11 +185,13 @@ examples: |-
|
||||||
When you're ready, start your application by running: docker compose up --build
|
When you're ready, start your application by running: docker compose up --build
|
||||||
|
|
||||||
Your application will be available at http://localhost:8000
|
Your application will be available at http://localhost:8000
|
||||||
|
|
||||||
|
Consult README.Docker.md for more information about using the generated files.
|
||||||
```
|
```
|
||||||
|
|
||||||
### Example of selecting ASP.NET Core
|
### Example of selecting ASP.NET Core
|
||||||
|
|
||||||
The following example shows the prompts that appear after selecting `ASP.NET Core` and example input. The ASP.NET Core template also creates a `README.Docker.md` file with additional information about building and deploying your application.
|
The following example shows the prompts that appear after selecting `ASP.NET Core` and example input.
|
||||||
|
|
||||||
```console
|
```console
|
||||||
? What application platform does your project use? ASP.NET Core
|
? What application platform does your project use? ASP.NET Core
|
||||||
|
@ -195,6 +211,36 @@ examples: |-
|
||||||
When you're ready, start your application by running: docker compose up --build
|
When you're ready, start your application by running: docker compose up --build
|
||||||
|
|
||||||
Your application will be available at http://localhost:8000
|
Your application will be available at http://localhost:8000
|
||||||
|
|
||||||
|
Consult README.Docker.md for more information about using the generated files.
|
||||||
|
```
|
||||||
|
|
||||||
|
### Example of selecting PHP with Apache
|
||||||
|
|
||||||
|
The following example shows the prompts that appear after selecting `PHP with Apache` and example input. The PHP with Apache template is suitable for both pure PHP applications and applications using Composer as a dependency manager. After running `docker init`, you must manually add any PHP extensions that are required by your application to the Dockerfile.
|
||||||
|
|
||||||
|
```console
|
||||||
|
? What application platform does your project use? PHP with Apache
|
||||||
|
? What version of PHP do you want to use? 8.2
|
||||||
|
? What's the relative directory (with a leading .) for your app? ./src
|
||||||
|
? What local port do you want to use to access your server? 9000
|
||||||
|
|
||||||
|
CREATED: .dockerignore
|
||||||
|
CREATED: Dockerfile
|
||||||
|
CREATED: compose.yaml
|
||||||
|
CREATED: README.Docker.md
|
||||||
|
|
||||||
|
✔ Your Docker files are ready!
|
||||||
|
|
||||||
|
Take a moment to review them and tailor them to your application.
|
||||||
|
|
||||||
|
If your application requires specific PHP extensions, you can follow the instructions in the Dockerfile to add them.
|
||||||
|
|
||||||
|
When you're ready, start your application by running: docker compose up --build
|
||||||
|
|
||||||
|
Your application will be available at http://localhost:9000
|
||||||
|
|
||||||
|
Consult README.Docker.md for more information about using the generated files.
|
||||||
```
|
```
|
||||||
|
|
||||||
### Example of selecting Other
|
### Example of selecting Other
|
||||||
|
@ -207,11 +253,14 @@ examples: |-
|
||||||
CREATED: .dockerignore
|
CREATED: .dockerignore
|
||||||
CREATED: Dockerfile
|
CREATED: Dockerfile
|
||||||
CREATED: compose.yaml
|
CREATED: compose.yaml
|
||||||
|
CREATED: README.Docker.md
|
||||||
|
|
||||||
✔ Your Docker files are ready!
|
✔ Your Docker files are ready!
|
||||||
|
|
||||||
Take a moment to review them and tailor them to your application.
|
Take a moment to review them and tailor them to your application.
|
||||||
|
|
||||||
When you're ready, start your application by running: docker compose up --build
|
When you're ready, start your application by running: docker compose up --build
|
||||||
|
|
||||||
|
Consult README.Docker.md for more information about using the generated files.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue