Sebastiaan van Stijn 324db4e44a update docker-compose.yml for compose v2, and remove temporary fix
This updates the instructions in the docker-compose.yml to use
"docker compose" (v2) instead of "docker-compose".

Also removing a workaround for a bug in older versions of compose,
where build-args did not properly inherit their value from the
current environment. Testing this scenario on a current version
of compose shows that that problem has been resolved:

Using this compose-file:

```yaml
services:
  docs:
    build:
      args:
        - JEKYLL_ENV
      context: .
```

And this Dockerfile:

```dockerfile
ARG JEKYLL_ENV=default

FROM alpine
ARG JEKYLL_ENV
RUN echo $JEKYLL_ENV >> /result.txt
CMD cat /result.txt
```

It looks like this issue has been resolved:

Without setting the `JEKYLL_ENV` environment variable, the Dockerfile correctly uses
the default value from the Dockerfile:

```console
docker compose build
[+] Building 0.6s (6/6) FINISHED
 => [internal] load build definition from Dockerfile                                         0.1s
 => => transferring dockerfile: 31B                                                          0.0s
 => [internal] load .dockerignore                                                            0.0s
 => => transferring context: 2B                                                              0.0s
 => [internal] load metadata for docker.io/library/alpine:latest                             0.0s
 => CACHED [1/2] FROM docker.io/library/alpine                                               0.0s
 => [2/2] RUN echo default >> /result.txt                                                    0.3s
 => exporting to image                                                                       0.0s
 => => exporting layers                                                                      0.0s
 => => writing image sha256:c22cfa2355a910991d1bd4f4d83a0b9d4fad7dc73b1ea83fba05f8949e564591 0.0s
 => => naming to docker.io/library/composeenv_docs                                           0.0s

docker compose run --rm docs
default
```

And when setting `JEKYLL_ENV`, it's used to override the default in the Dockerfile:

```console
JEKYLL_ENV=production docker compose build
[+] Building 2.6s (6/6) FINISHED
 => [internal] load build definition from Dockerfile                                         0.5s
 => => transferring dockerfile: 120B                                                         0.0s
 => [internal] load .dockerignore                                                            0.4s
 => => transferring context: 2B                                                              0.0s
 => [internal] load metadata for docker.io/library/alpine:latest                             0.0s
 => [1/2] FROM docker.io/library/alpine                                                      0.0s
 => [2/2] RUN echo production >> /result.txt                                                 1.6s
 => exporting to image                                                                       0.1s
 => => exporting layers                                                                      0.1s
 => => writing image sha256:a05ca33d07d411660bd26f817a3d9201f3d7f15d198879cadc70e83e5d1f7fd5 0.0s
 => => naming to docker.io/library/composeenv_docs                                           0.0s

docker compose run --rm docs
production
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-07 12:38:44 +02:00
2022-04-06 16:08:51 +01:00
2022-04-06 16:08:51 +01:00
2022-02-07 22:42:07 +00:00
2022-02-28 11:07:12 +00:00
2022-03-30 19:34:33 +05:30
2022-03-01 16:27:33 -06:00
2022-03-23 18:21:34 +01:00
2022-04-06 16:08:51 +01:00
2021-08-31 14:35:20 +00:00
2022-03-25 17:58:00 +00:00
2022-01-13 20:57:22 +05:30
2022-03-24 12:43:41 -05:00
2022-03-29 17:16:40 -05:00
2022-01-14 22:33:58 +05:30
2021-07-12 09:07:16 +01:00
2021-07-12 09:07:16 +01:00
2022-02-02 18:46:44 +00:00
2022-02-02 18:46:44 +00:00

Docs @ Docker

Welcome to Docker Documentation

Welcome to the Docker Documentation repository. This is the source for https://docs.docker.com/.

Feel free to send us pull requests and file issues. Our docs are completely open source and we deeply appreciate contributions from the Docker community!

Provide feedback

Wed love to hear your feedback. Please file documentation issues only in the docs GitHub repository. You can file a new issue to suggest improvements or if you see any errors in the existing documentation.

Before submitting a new issue, check whether the issue has already been reported. You can join the discussion using an emoji, or by adding a comment to an existing issue. If possible, we recommend that you suggest a fix to the issue by creating a pull request.

You can ask general questions and get community support through the Docker Community Slack. Personalized support is available through the Docker Pro, Team, and Business subscriptions. See Docker Pricing for details.

If you have an idea for a new feature or behavior change in a specific aspect of Docker, or have found a product bug, file that issue in the project's code repository.

We've made it really easy for you to file new issues.

  • Click New issue on the docs repository and fill in the details, or
  • Click Request docs changes in the right column of every page on docs.docker.com and add the details.

Docs feedback on each page

Contribute to Docker docs

We value your contribution. We'd like to make it as easy as possible to submit your contributions to the Docker docs repository. Changes to the docs are handled through pull requests against the master branch. To learn how to contribute, see CONTRIBUTING.md.

Copyright 2013-2022 Docker, inc, released under the Apache 2.0 license.

Description
No description provided
Readme Apache-2.0 874 MiB
Languages
Markdown 97.3%
HTML 1.7%
CSS 0.4%
JavaScript 0.2%
Go 0.1%