From 3d0f7b6626b84fb6c23fb84e228ac5280cae49ff Mon Sep 17 00:00:00 2001 From: Craig Osterhout <103533812+craig-osterhout@users.noreply.github.com> Date: Tue, 5 Dec 2023 08:23:46 -0800 Subject: [PATCH] update docker init reference (#18795) * update docker init for 4.26 Signed-off-by: Craig Osterhout --- content/language/nodejs/containerize.md | 2 + content/language/nodejs/develop.md | 1 + content/language/python/containerize.md | 2 + content/language/python/develop.md | 2 + content/language/rust/build-images.md | 4 +- content/language/rust/develop.md | 1 + data/init-cli/docker_init.yaml | 57 +++++++++++++++++++++++-- 7 files changed, 64 insertions(+), 5 deletions(-) diff --git a/content/language/nodejs/containerize.md b/content/language/nodejs/containerize.md index 5a13e74819..c38a1b3741 100644 --- a/content/language/nodejs/containerize.md +++ b/content/language/nodejs/containerize.md @@ -70,6 +70,7 @@ This utility will walk you through creating the following files with sensible de - .dockerignore - Dockerfile - compose.yaml + - README.Docker.md Let's get started! @@ -93,6 +94,7 @@ directory. │ ├── Dockerfile │ ├── package-lock.json │ ├── package.json +│ ├── README.Docker.md │ └── README.md ``` diff --git a/content/language/nodejs/develop.md b/content/language/nodejs/develop.md index 9e3a0a32b9..bf9e8d9fbf 100644 --- a/content/language/nodejs/develop.md +++ b/content/language/nodejs/develop.md @@ -105,6 +105,7 @@ directory. │ ├── Dockerfile │ ├── package-lock.json │ ├── package.json +│ ├── README.Docker.md │ └── README.md ``` diff --git a/content/language/python/containerize.md b/content/language/python/containerize.md index cb6bb86a31..c2cfe3f020 100644 --- a/content/language/python/containerize.md +++ b/content/language/python/containerize.md @@ -60,6 +60,7 @@ This utility will walk you through creating the following files with sensible de - .dockerignore - Dockerfile - compose.yaml + - README.Docker.md Let's get started! @@ -79,6 +80,7 @@ directory. │ ├── .dockerignore │ ├── compose.yaml │ ├── Dockerfile +│ ├── README.Docker.md │ └── README.md ``` diff --git a/content/language/python/develop.md b/content/language/python/develop.md index 015448e3fa..f0ae5a6c06 100644 --- a/content/language/python/develop.md +++ b/content/language/python/develop.md @@ -35,6 +35,7 @@ You'll need to clone a new repository to get a sample application that includes - .dockerignore - Dockerfile - compose.yaml + - README.Docker.md Let's get started! @@ -118,6 +119,7 @@ directory. │ ├── .dockerignore │ ├── compose.yaml │ ├── Dockerfile +│ ├── README.Docker.md │ └── README.md ``` diff --git a/content/language/rust/build-images.md b/content/language/rust/build-images.md index fe9c81e9d6..8581696e29 100644 --- a/content/language/rust/build-images.md +++ b/content/language/rust/build-images.md @@ -62,6 +62,7 @@ This utility will walk you through creating the following files with sensible de - .dockerignore - Dockerfile - compose.yaml + - README.Docker.md Let's get started! @@ -70,11 +71,12 @@ Let's get started! ? 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: - Dockerfile - .dockerignore - compose.yaml + - README.Docker.md 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 diff --git a/content/language/rust/develop.md b/content/language/rust/develop.md index f30d2d2152..10e289cff7 100644 --- a/content/language/rust/develop.md +++ b/content/language/rust/develop.md @@ -86,6 +86,7 @@ For the sample application, you'll use a variation of the backend from the react - .dockerignore - Dockerfile - compose.yaml + - README.Docker.md Let's get started! diff --git a/data/init-cli/docker_init.yaml b/data/init-cli/docker_init.yaml index 0b62050aa5..25b9951c2d 100644 --- a/data/init-cli/docker_init.yaml +++ b/data/init-cli/docker_init.yaml @@ -8,6 +8,7 @@ long: |- * .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. @@ -15,13 +16,14 @@ long: |- > > 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. - {: .warning} + { .warning } After running `docker init`, you can choose one of the following templates: * ASP.NET Core: Suitable for an ASP.NET Core application. * Go: Suitable for a Go 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. * Rust: Suitable for a Rust server application. * Other: General purpose starting point for containerizing your application. @@ -65,15 +67,17 @@ examples: |- - .dockerignore - Dockerfile - compose.yaml + - README.Docker.md Let's get started! ? What application platform does your project use? [Use arrows to move, type to filter] - > Go - (detected) suitable for a Go server application - ASP.NET Core - suitable for an ASP.NET Core application + > PHP with Apache - (detected) suitable for a PHP web application + Go - (detected) suitable for a Go server application Python - suitable for a Python server application Node - suitable for a Node 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 Don't see something you need? Let us know! Quit @@ -92,6 +96,7 @@ examples: |- CREATED: .dockerignore CREATED: Dockerfile CREATED: compose.yaml + CREATED: README.Docker.md ✔ Your Docker files are ready! @@ -100,6 +105,8 @@ examples: |- When you're ready, start your application by running: docker compose up --build 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 @@ -118,6 +125,7 @@ examples: |- CREATED: .dockerignore CREATED: Dockerfile CREATED: compose.yaml + CREATED: README.Docker.md ✔ Your Docker files are ready! @@ -126,6 +134,8 @@ examples: |- When you're ready, start your application by running: docker compose up --build 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 @@ -141,6 +151,7 @@ examples: |- CREATED: .dockerignore CREATED: Dockerfile CREATED: compose.yaml + CREATED: README.Docker.md ✔ Your Docker files are ready! @@ -149,6 +160,8 @@ examples: |- When you're ready, start your application by running: docker compose up --build 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 @@ -163,6 +176,7 @@ examples: |- CREATED: .dockerignore CREATED: Dockerfile CREATED: compose.yaml + CREATED: README.Docker.md ✔ Your Docker files are ready! @@ -171,11 +185,13 @@ examples: |- When you're ready, start your application by running: docker compose up --build 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 - 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 ? 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 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 @@ -207,11 +253,14 @@ examples: |- 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. 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. ```