mirror of https://github.com/docker/docs.git
Remove references to the `--single-file` argument, which was removed from Docker App
This commit is contained in:
parent
3dc5416e5b
commit
bf98bab82f
|
@ -61,62 +61,51 @@ it initializes a new project based on the Compose file.
|
||||||
Use the following command to initialize a new empty project called "hello-world".
|
Use the following command to initialize a new empty project called "hello-world".
|
||||||
|
|
||||||
```
|
```
|
||||||
$ docker app init --single-file hello-world
|
$ docker app init hello-world
|
||||||
Created "hello-world.dockerapp"
|
Created "hello-world.dockerapp"
|
||||||
```
|
```
|
||||||
|
|
||||||
The command produces a single file in your current directory called `hello-world.dockerapp`.
|
The command produces a new directory containing three YAML files. The name of the directory is the name of the
|
||||||
The format of the file name is <project-name> appended with `.dockerapp`.
|
project with `.dockerapp` appended, and the three YAML files are:
|
||||||
|
|
||||||
```
|
|
||||||
$ ls
|
|
||||||
hello-world.dockerapp
|
|
||||||
```
|
|
||||||
|
|
||||||
If you run `docker app init` without the `--single-file` flag, you get a new directory containing three YAML files.
|
|
||||||
The name of the directory is the name of the project with `.dockerapp` appended, and the three YAML files are:
|
|
||||||
|
|
||||||
- `docker-compose.yml`
|
- `docker-compose.yml`
|
||||||
- `metadata.yml`
|
- `metadata.yml`
|
||||||
- `parameters.yml`
|
- `parameters.yml`
|
||||||
|
|
||||||
However, the `--single-file` option merges the three YAML files into a single YAML file with three sections.
|
Inspect the YAML files with the following commands.
|
||||||
Each of these sections relates to one of the three YAML files mentioned previously: `docker-compose.yml`,
|
|
||||||
`metadata.yml`, and `parameters.yml`. Using the `--single-file` option enables you to share your application
|
|
||||||
using a single configuration file.
|
|
||||||
|
|
||||||
Inspect the YAML with the following command.
|
|
||||||
|
|
||||||
```
|
```
|
||||||
$ cat hello-world.dockerapp
|
$ cd hello-world.dockerapp/
|
||||||
# Application metadata - equivalent to metadata.yml.
|
|
||||||
|
$ cat docker-compose.yml
|
||||||
|
version: "3.6"
|
||||||
|
services: {}
|
||||||
|
|
||||||
|
$ cat metadata.yml
|
||||||
version: 0.1.0
|
version: 0.1.0
|
||||||
name: hello-world
|
name: hello-world
|
||||||
description:
|
description:
|
||||||
---
|
|
||||||
# Application services - equivalent to docker-compose.yml.
|
$ cat parameters.yml
|
||||||
version: "3.6"
|
|
||||||
services: {}
|
|
||||||
---
|
|
||||||
# Default application parameters - equivalent to parameters.yml.
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Your file might be more verbose.
|
Your files might be more verbose.
|
||||||
|
|
||||||
Notice that each of the three sections is separated by a set of three dashes ("---"). Let's quickly describe each section.
|
Let's quickly describe each file.
|
||||||
|
|
||||||
The first section of the file specifies identification metadata such as name, version,
|
`docker-compose.yml` describes the application.
|
||||||
description and maintainers. It accepts key-value pairs. This part of the file can be a separate file called `metadata.yml`
|
|
||||||
|
|
||||||
The second section of the file describes the application. It can be a separate file called `docker-compose.yml`.
|
`metadata.yml` specifies identification metadata such as name, version, description and maintainers. It accepts
|
||||||
|
key-value pairs.
|
||||||
|
|
||||||
The final section specifies default values for application parameters. It can be a separate file called `parameters.yml`
|
`parameters.yml` specifies default values for application parameters.
|
||||||
|
|
||||||
### Populate the project
|
### Populate the project
|
||||||
|
|
||||||
This section describes editing the project YAML file so that it runs a simple web app.
|
This section describes editing the project YAML files so that it runs a simple web app.
|
||||||
|
|
||||||
Use your preferred editor to edit the `hello-world.dockerapp` YAML file and update the application section with
|
Use your preferred editor to edit the `docker-compose.yml` YAML file and update it with
|
||||||
the following information:
|
the following information:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -129,7 +118,7 @@ services:
|
||||||
- ${hello.port}:5678
|
- ${hello.port}:5678
|
||||||
```
|
```
|
||||||
|
|
||||||
Update the `Parameters` section to the following:
|
Update the `parameters.yml` file to the following:
|
||||||
|
|
||||||
```
|
```
|
||||||
hello:
|
hello:
|
||||||
|
@ -137,8 +126,6 @@ hello:
|
||||||
text: Hello world!
|
text: Hello world!
|
||||||
```
|
```
|
||||||
|
|
||||||
The sections of the YAML file are currently order-based. This means it's important they remain in the order we've explained, with the _metadata_ section being first, the _app_ section being second, and the _parameters_ section being last. This may change to name-based sections in future releases.
|
|
||||||
|
|
||||||
Save the changes.
|
Save the changes.
|
||||||
|
|
||||||
The application is updated to run a single-container application based on the `hashicorp/http-echo` web server image.
|
The application is updated to run a single-container application based on the `hashicorp/http-echo` web server image.
|
||||||
|
|
Loading…
Reference in New Issue