From fdc362bf553f21f21b80ca83451133079bd0c8b4 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 13 Sep 2021 17:14:32 +0200 Subject: [PATCH] [v2] docs: markdown and link fixes Signed-off-by: Sebastiaan van Stijn --- docs/reference/compose.md | 10 +++++--- docs/reference/compose_build.md | 2 +- docs/reference/compose_events.md | 2 +- docs/reference/compose_kill.md | 4 +-- docs/reference/compose_ps.md | 4 +-- docs/reference/compose_pull.md | 12 ++++----- docs/reference/compose_push.md | 16 ++++++------ docs/reference/compose_restart.md | 2 +- docs/reference/compose_rm.md | 4 +-- docs/reference/compose_run.md | 30 ++++++++++++----------- docs/reference/compose_start.md | 2 +- docs/reference/compose_stop.md | 2 +- docs/reference/compose_top.md | 4 +-- docs/reference/compose_unpause.md | 2 +- docs/reference/compose_version.md | 0 docs/reference/docker_compose.yaml | 2 +- docs/reference/docker_compose_events.yaml | 2 +- docs/reference/docker_compose_kill.yaml | 4 +-- docs/reference/docker_compose_ps.yaml | 2 +- docs/reference/docker_compose_pull.yaml | 2 +- docs/reference/docker_compose_push.yaml | 20 ++++++++++++++- docs/reference/docker_compose_rm.yaml | 2 +- docs/reference/docker_compose_run.yaml | 2 +- docs/reference/docker_compose_top.yaml | 2 +- 24 files changed, 78 insertions(+), 56 deletions(-) create mode 100644 docs/reference/compose_version.md diff --git a/docs/reference/compose.md b/docs/reference/compose.md index 1921e6793..a3bba2985 100644 --- a/docs/reference/compose.md +++ b/docs/reference/compose.md @@ -15,9 +15,10 @@ to their predecessors. For example, consider this command line: -``` +```console $ docker compose -f docker-compose.yml -f docker-compose.admin.yml run backup_db ``` + The `docker-compose.yml` file might specify a `webapp` service. ```yaml @@ -56,8 +57,9 @@ from the command line or by setting up a `COMPOSE_FILE` environment variable in For an example of using the `-f` option at the command line, suppose you are running the Compose Rails sample, and have a `compose.yaml` file in a directory called `sandbox/rails`. You can use a command like `docker compose pull` to get the postgres image for the db service from anywhere by using the `-f` flag as follows: -``` -docker compose -f ~/sandbox/rails/compose.yaml pull db + +```console +$ docker compose -f ~/sandbox/rails/compose.yaml pull db ``` ### Use `-p` to specify a project name @@ -69,7 +71,7 @@ Project name can also be set by `COMPOSE_PROJECT_NAME` environment variable. Most compose subcommand can be ran without a compose file, just passing project name to retrieve the relevant resources. -``` +```console $ docker compose -p my_project ps -a NAME SERVICE STATUS PORTS my_project_demo_1 demo running diff --git a/docs/reference/compose_build.md b/docs/reference/compose_build.md index caa0f55eb..df3d78f8a 100644 --- a/docs/reference/compose_build.md +++ b/docs/reference/compose_build.md @@ -9,4 +9,4 @@ the image is tagged with that name, substituting any variables beforehand. See [variable interpolation](https://github.com/compose-spec/compose-spec/blob/master/spec.md#interpolation). If you change a service's `Dockerfile` or the contents of its build directory, -run `docker compose build` to rebuild it. \ No newline at end of file +run `docker compose build` to rebuild it. diff --git a/docs/reference/compose_events.md b/docs/reference/compose_events.md index f74cd9b76..4225974a9 100644 --- a/docs/reference/compose_events.md +++ b/docs/reference/compose_events.md @@ -19,4 +19,4 @@ With the `--json` flag, a json object is printed one per line with the format: } ``` -The events that can be received using this can be seen [here](/engine/reference/commandline/events/#object-types). +The events that can be received using this can be seen [here](https://docs.docker.com/engine/reference/commandline/events/#object-types). diff --git a/docs/reference/compose_kill.md b/docs/reference/compose_kill.md index 8552b5570..cb8fb249a 100644 --- a/docs/reference/compose_kill.md +++ b/docs/reference/compose_kill.md @@ -3,6 +3,6 @@ Forces running containers to stop by sending a `SIGKILL` signal. Optionally the signal can be passed, for example: -``` -docker-compose kill -s SIGINT +```console +$ docker-compose kill -s SIGINT ``` diff --git a/docs/reference/compose_ps.md b/docs/reference/compose_ps.md index e3a1e0a33..ac7faaea2 100644 --- a/docs/reference/compose_ps.md +++ b/docs/reference/compose_ps.md @@ -3,9 +3,9 @@ Lists containers for a Compose project, with current status and exposed ports. -``` +```console $ docker compose ps NAME SERVICE STATUS PORTS example_foo_1 foo running (healthy) 0.0.0.0:8000->80/tcp example_bar_1 bar exited (1) -``` \ No newline at end of file +``` diff --git a/docs/reference/compose_pull.md b/docs/reference/compose_pull.md index 67933fbe0..0f6b6845e 100644 --- a/docs/reference/compose_pull.md +++ b/docs/reference/compose_pull.md @@ -7,7 +7,7 @@ those images. ## Examples -suppose you have this `compose.yaml` file from the Quickstart: [Compose and Rails sample](compose/rails/). +suppose you have this `compose.yaml`: ```yaml services: @@ -17,18 +17,18 @@ services: build: . command: bundle exec rails s -p 3000 -b '0.0.0.0' volumes: - - .:/myapp + - .:/myapp ports: - - "3000:3000" + - "3000:3000" depends_on: - - db + - db ``` -If you run `docker compose pull ServiceName` in the same directory as the `ccompose.yaml` file that defines the service, +If you run `docker compose pull ServiceName` in the same directory as the `compose.yaml` file that defines the service, Docker pulls the associated image. For example, to call the postgres image configured as the db service in our example, you would run `docker compose pull db`. -``` +```console $ docker compose pull db [+] Running 1/15 ⠸ db Pulling 12.4s diff --git a/docs/reference/compose_push.md b/docs/reference/compose_push.md index 2c21c37e4..9015d961a 100644 --- a/docs/reference/compose_push.md +++ b/docs/reference/compose_push.md @@ -11,11 +11,11 @@ Examples ```yaml services: - service1: - build: . - image: localhost:5000/yourimage ## goes to local registry - - service2: - build: . - image: your-dockerid/yourimage ## goes to your repository on Docker Hub -``` \ No newline at end of file + service1: + build: . + image: localhost:5000/yourimage ## goes to local registry + + service2: + build: . + image: your-dockerid/yourimage ## goes to your repository on Docker Hub +``` diff --git a/docs/reference/compose_restart.md b/docs/reference/compose_restart.md index 30d62d698..0e38b5652 100644 --- a/docs/reference/compose_restart.md +++ b/docs/reference/compose_restart.md @@ -7,4 +7,4 @@ after restarting. If you are looking to configure a service's restart policy, please refer to [restart](https://github.com/compose-spec/compose-spec/blob/master/spec.md#restart) -or [restart_policy](https://github.com/compose-spec/compose-spec/blob/master/deploy.md#restart_policy). \ No newline at end of file +or [restart_policy](https://github.com/compose-spec/compose-spec/blob/master/deploy.md#restart_policy). diff --git a/docs/reference/compose_rm.md b/docs/reference/compose_rm.md index af14a7975..da4584882 100644 --- a/docs/reference/compose_rm.md +++ b/docs/reference/compose_rm.md @@ -10,9 +10,9 @@ Any data which is not in a volume is lost. Running the command with no options also removes one-off containers created by `docker compose run`: -``` +```console $ docker compose rm Going to remove djangoquickstart_web_run_1 Are you sure? [yN] y Removing djangoquickstart_web_run_1 ... done -``` \ No newline at end of file +``` diff --git a/docs/reference/compose_run.md b/docs/reference/compose_run.md index 19b8ec663..c2d4eab15 100644 --- a/docs/reference/compose_run.md +++ b/docs/reference/compose_run.md @@ -3,8 +3,11 @@ Runs a one-time command against a service. -the following command starts the `web` service and runs `bash` as its command. -`docker compose run web bash` +the following command starts the `web` service and runs `bash` as its command: + +```console +$ docker compose run web bash +``` Commands you use with run start in new containers with configuration defined by that of the service, including volumes, links, and other details. However, there are two important differences: @@ -17,38 +20,37 @@ The second difference is that the `docker compose run` command does not create a service configuration. This prevents port collisions with already-open ports. If you do want the service’s ports to be created and mapped to the host, specify the `--service-ports` -``` -docker compose run --service-ports web python manage.py shell +```console +$ docker compose run --service-ports web python manage.py shell ``` Alternatively, manual port mapping can be specified with the `--publish` or `-p` options, just as when using docker run: +```console +$ docker compose run --publish 8080:80 -p 2022:22 -p 127.0.0.1:2021:21 web python manage.py shell ``` -docker compose run --publish 8080:80 -p 2022:22 -p 127.0.0.1:2021:21 web python manage.py shell -``` - If you start a service configured with links, the run command first checks to see if the linked service is running and starts the service if it is stopped. Once all the linked services are running, the run executes the command you passed it. For example, you could run: -``` -docker compose run db psql -h db -U docker +```console +$ docker compose run db psql -h db -U docker ``` This opens an interactive PostgreSQL shell for the linked `db` container. If you do not want the run command to start linked containers, use the `--no-deps` flag: -``` -docker compose run --no-deps web python manage.py shell +```console +$ docker compose run --no-deps web python manage.py shell ``` If you want to remove the container after running while overriding the container’s restart policy, use the `--rm` flag: -``` -docker compose run --rm web python manage.py db upgrade +```console +$ docker compose run --rm web python manage.py db upgrade ``` This runs a database upgrade script, and removes the container when finished running, even if a restart policy is -specified in the service configuration. \ No newline at end of file +specified in the service configuration. diff --git a/docs/reference/compose_start.md b/docs/reference/compose_start.md index 868415222..569dfe58e 100644 --- a/docs/reference/compose_start.md +++ b/docs/reference/compose_start.md @@ -1,4 +1,4 @@ ## Description -Starts existing containers for a service. \ No newline at end of file +Starts existing containers for a service. diff --git a/docs/reference/compose_stop.md b/docs/reference/compose_stop.md index 7fdbe8958..5d5c5db90 100644 --- a/docs/reference/compose_stop.md +++ b/docs/reference/compose_stop.md @@ -1,4 +1,4 @@ ## Description -Stops running containers without removing them. They can be started again with `docker compose start`. \ No newline at end of file +Stops running containers without removing them. They can be started again with `docker compose start`. diff --git a/docs/reference/compose_top.md b/docs/reference/compose_top.md index d2d30e80a..5ccb40bbf 100644 --- a/docs/reference/compose_top.md +++ b/docs/reference/compose_top.md @@ -5,9 +5,9 @@ Displays the running processes. ## Examples -``` +```console $ docker compose top example_foo_1 UID PID PPID C STIME TTY TIME CMD root 142353 142331 2 15:33 ? 00:00:00 ping localhost -c 5 -``` \ No newline at end of file +``` diff --git a/docs/reference/compose_unpause.md b/docs/reference/compose_unpause.md index 6bb6cd91d..b071841a8 100644 --- a/docs/reference/compose_unpause.md +++ b/docs/reference/compose_unpause.md @@ -1,4 +1,4 @@ ## Description -Unpauses paused containers of a service. \ No newline at end of file +Unpauses paused containers of a service. diff --git a/docs/reference/compose_version.md b/docs/reference/compose_version.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/reference/docker_compose.yaml b/docs/reference/docker_compose.yaml index 7a971d9c5..cb8caeaba 100644 --- a/docs/reference/docker_compose.yaml +++ b/docs/reference/docker_compose.yaml @@ -1,6 +1,6 @@ command: docker compose short: Docker Compose -long: "You can use compose subcommand, `docker compose [-f ...] [options] [COMMAND] [ARGS...]`, to build and manage\nmultiple services in Docker containers.\n\n### Use `-f` to specify name and path of one or more Compose files\nUse the `-f` flag to specify the location of a Compose configuration file.\n\n#### Specifying multiple Compose files\nYou can supply multiple `-f` configuration files. When you supply multiple files, Compose combines them into a single \nconfiguration. Compose builds the configuration in the order you supply the files. Subsequent files override and add \nto their predecessors.\n\nFor example, consider this command line:\n\n```\n$ docker compose -f docker-compose.yml -f docker-compose.admin.yml run backup_db\n```\nThe `docker-compose.yml` file might specify a `webapp` service.\n\n```yaml\nservices:\n webapp:\n image: examples/web\n ports:\n - \"8000:8000\"\n volumes:\n - \"/data\"\n```\nIf the `docker-compose.admin.yml` also specifies this same service, any matching fields override the previous file. \nNew values, add to the `webapp` service configuration.\n\n```yaml\nservices:\n webapp:\n build: .\n environment:\n - DEBUG=1\n```\n\nWhen you use multiple Compose files, all paths in the files are relative to the first configuration file specified \nwith `-f`. You can use the `--project-directory` option to override this base path.\n\nUse a `-f` with `-` (dash) as the filename to read the configuration from stdin. When stdin is used all paths in the \nconfiguration are relative to the current working directory.\n\nThe `-f` flag is optional. If you don’t provide this flag on the command line, Compose traverses the working directory \nand its parent directories looking for a `compose.yaml` or `docker-compose.yaml` file.\n\n#### Specifying a path to a single Compose file\nYou can use the `-f` flag to specify a path to a Compose file that is not located in the current directory, either \nfrom the command line or by setting up a `COMPOSE_FILE` environment variable in your shell or in an environment file.\n\nFor an example of using the `-f` option at the command line, suppose you are running the Compose Rails sample, and \nhave a `compose.yaml` file in a directory called `sandbox/rails`. You can use a command like `docker compose pull` to \nget the postgres image for the db service from anywhere by using the `-f` flag as follows: \n```\ndocker compose -f ~/sandbox/rails/compose.yaml pull db\n```\n\n### Use `-p` to specify a project name\n\nEach configuration has a project name. If you supply a `-p` flag, you can specify a project name. If you don’t \nspecify the flag, Compose uses the current directory name. \nProject name can also be set by `COMPOSE_PROJECT_NAME` environment variable.\n\nMost compose subcommand can be ran without a compose file, just passing \nproject name to retrieve the relevant resources.\n\n```\n$ docker compose -p my_project ps -a\nNAME SERVICE STATUS PORTS\nmy_project_demo_1 demo running \n\n$ docker compose -p my_project logs\ndemo_1 | PING localhost (127.0.0.1): 56 data bytes\ndemo_1 | 64 bytes from 127.0.0.1: seq=0 ttl=64 time=0.095 ms\n```\n\n### Use profiles to enable optional services\n\nUse `--profile` to specify one or more active profiles\nCalling `docker compose --profile frontend up` will start the services with the profile `frontend` and services \nwithout any specified profiles. \nYou can also enable multiple profiles, e.g. with `docker compose --profile frontend --profile debug up` the profiles `frontend` and `debug` will be enabled.\n\nProfiles can also be set by `COMPOSE_PROFILES` environment variable.\n\n### Set up environment variables\n\nYou can set environment variables for various docker compose options, including the `-f`, `-p` and `--profiles` flags.\n\nSetting the `COMPOSE_FILE` environment variable is equivalent to passing the `-f` flag,\n`COMPOSE_PROJECT_NAME` environment variable does the same for to the `-p` flag,\nand so does `COMPOSE_PROFILES` environment variable for to the `--profiles` flag.\n\nIf flags are explicitly set on command line, associated environment variable is ignored" +long: "You can use compose subcommand, `docker compose [-f ...] [options] [COMMAND] [ARGS...]`, to build and manage\nmultiple services in Docker containers.\n\n### Use `-f` to specify name and path of one or more Compose files\nUse the `-f` flag to specify the location of a Compose configuration file.\n\n#### Specifying multiple Compose files\nYou can supply multiple `-f` configuration files. When you supply multiple files, Compose combines them into a single \nconfiguration. Compose builds the configuration in the order you supply the files. Subsequent files override and add \nto their predecessors.\n\nFor example, consider this command line:\n\n```console\n$ docker compose -f docker-compose.yml -f docker-compose.admin.yml run backup_db\n```\n\nThe `docker-compose.yml` file might specify a `webapp` service.\n\n```yaml\nservices:\n webapp:\n image: examples/web\n ports:\n - \"8000:8000\"\n volumes:\n - \"/data\"\n```\nIf the `docker-compose.admin.yml` also specifies this same service, any matching fields override the previous file. \nNew values, add to the `webapp` service configuration.\n\n```yaml\nservices:\n webapp:\n build: .\n environment:\n - DEBUG=1\n```\n\nWhen you use multiple Compose files, all paths in the files are relative to the first configuration file specified \nwith `-f`. You can use the `--project-directory` option to override this base path.\n\nUse a `-f` with `-` (dash) as the filename to read the configuration from stdin. When stdin is used all paths in the \nconfiguration are relative to the current working directory.\n\nThe `-f` flag is optional. If you don’t provide this flag on the command line, Compose traverses the working directory \nand its parent directories looking for a `compose.yaml` or `docker-compose.yaml` file.\n\n#### Specifying a path to a single Compose file\nYou can use the `-f` flag to specify a path to a Compose file that is not located in the current directory, either \nfrom the command line or by setting up a `COMPOSE_FILE` environment variable in your shell or in an environment file.\n\nFor an example of using the `-f` option at the command line, suppose you are running the Compose Rails sample, and \nhave a `compose.yaml` file in a directory called `sandbox/rails`. You can use a command like `docker compose pull` to \nget the postgres image for the db service from anywhere by using the `-f` flag as follows: \n\n```console\n$ docker compose -f ~/sandbox/rails/compose.yaml pull db\n```\n\n### Use `-p` to specify a project name\n\nEach configuration has a project name. If you supply a `-p` flag, you can specify a project name. If you don’t \nspecify the flag, Compose uses the current directory name. \nProject name can also be set by `COMPOSE_PROJECT_NAME` environment variable.\n\nMost compose subcommand can be ran without a compose file, just passing \nproject name to retrieve the relevant resources.\n\n```console\n$ docker compose -p my_project ps -a\nNAME SERVICE STATUS PORTS\nmy_project_demo_1 demo running \n\n$ docker compose -p my_project logs\ndemo_1 | PING localhost (127.0.0.1): 56 data bytes\ndemo_1 | 64 bytes from 127.0.0.1: seq=0 ttl=64 time=0.095 ms\n```\n\n### Use profiles to enable optional services\n\nUse `--profile` to specify one or more active profiles\nCalling `docker compose --profile frontend up` will start the services with the profile `frontend` and services \nwithout any specified profiles. \nYou can also enable multiple profiles, e.g. with `docker compose --profile frontend --profile debug up` the profiles `frontend` and `debug` will be enabled.\n\nProfiles can also be set by `COMPOSE_PROFILES` environment variable.\n\n### Set up environment variables\n\nYou can set environment variables for various docker compose options, including the `-f`, `-p` and `--profiles` flags.\n\nSetting the `COMPOSE_FILE` environment variable is equivalent to passing the `-f` flag,\n`COMPOSE_PROJECT_NAME` environment variable does the same for to the `-p` flag,\nand so does `COMPOSE_PROFILES` environment variable for to the `--profiles` flag.\n\nIf flags are explicitly set on command line, associated environment variable is ignored" usage: docker compose pname: docker plink: docker.yaml diff --git a/docs/reference/docker_compose_events.yaml b/docs/reference/docker_compose_events.yaml index 5391b7e03..888030ba3 100644 --- a/docs/reference/docker_compose_events.yaml +++ b/docs/reference/docker_compose_events.yaml @@ -19,7 +19,7 @@ long: |- } ``` - The events that can be received using this can be seen [here](/engine/reference/commandline/events/#object-types). + The events that can be received using this can be seen [here](https://docs.docker.com/engine/reference/commandline/events/#object-types). usage: docker compose events [options] [--] [SERVICE...] pname: docker compose plink: docker_compose.yaml diff --git a/docs/reference/docker_compose_kill.yaml b/docs/reference/docker_compose_kill.yaml index 7a377c0a7..39f97a4b2 100644 --- a/docs/reference/docker_compose_kill.yaml +++ b/docs/reference/docker_compose_kill.yaml @@ -3,8 +3,8 @@ short: Force stop service containers. long: |- Forces running containers to stop by sending a `SIGKILL` signal. Optionally the signal can be passed, for example: - ``` - docker-compose kill -s SIGINT + ```console + $ docker-compose kill -s SIGINT ``` usage: docker compose kill [options] [SERVICE...] pname: docker compose diff --git a/docs/reference/docker_compose_ps.yaml b/docs/reference/docker_compose_ps.yaml index cdb294ae3..561e0da54 100644 --- a/docs/reference/docker_compose_ps.yaml +++ b/docs/reference/docker_compose_ps.yaml @@ -1,6 +1,6 @@ command: docker compose ps short: List containers -long: "Lists containers for a Compose project, with current status and exposed ports.\n\n```\n$ docker compose ps\nNAME SERVICE STATUS PORTS\nexample_foo_1 foo running (healthy) 0.0.0.0:8000->80/tcp\nexample_bar_1 bar exited (1) \n```" +long: "Lists containers for a Compose project, with current status and exposed ports.\n\n```console\n$ docker compose ps\nNAME SERVICE STATUS PORTS\nexample_foo_1 foo running (healthy) 0.0.0.0:8000->80/tcp\nexample_bar_1 bar exited (1) \n```" usage: docker compose ps [SERVICE...] pname: docker compose plink: docker_compose.yaml diff --git a/docs/reference/docker_compose_pull.yaml b/docs/reference/docker_compose_pull.yaml index fe755d750..10e87f0ea 100644 --- a/docs/reference/docker_compose_pull.yaml +++ b/docs/reference/docker_compose_pull.yaml @@ -51,7 +51,7 @@ options: experimentalcli: false kubernetes: false swarm: false -examples: "suppose you have this `compose.yaml` file from the Quickstart: [Compose and Rails sample](compose/rails/).\n\n```yaml\nservices:\n db:\n image: postgres\n web:\n build: .\n command: bundle exec rails s -p 3000 -b '0.0.0.0'\n volumes:\n - .:/myapp\n ports:\n - \"3000:3000\"\n depends_on:\n - db\n```\n\nIf you run `docker compose pull ServiceName` in the same directory as the `ccompose.yaml` file that defines the service, \nDocker pulls the associated image. For example, to call the postgres image configured as the db service in our example, \nyou would run `docker compose pull db`.\n\n```\n$ docker compose pull db\n[+] Running 1/15\n ⠸ db Pulling 12.4s\n ⠿ 45b42c59be33 Already exists 0.0s\n ⠹ 40adec129f1a Downloading 3.374MB/4.178MB 9.3s\n ⠹ b4c431d00c78 Download complete 9.3s\n ⠹ 2696974e2815 Download complete 9.3s\n ⠹ 564b77596399 Downloading 5.622MB/7.965MB 9.3s\n ⠹ 5044045cf6f2 Downloading 216.7kB/391.1kB 9.3s\n ⠹ d736e67e6ac3 Waiting 9.3s\n ⠹ 390c1c9a5ae4 Waiting 9.3s\n ⠹ c0e62f172284 Waiting 9.3s\n ⠹ ebcdc659c5bf Waiting 9.3s\n ⠹ 29be22cb3acc Waiting 9.3s\n ⠹ f63c47038e66 Waiting 9.3s\n ⠹ 77a0c198cde5 Waiting 9.3s\n ⠹ c8752d5b785c Waiting 9.3s\n``̀" +examples: "suppose you have this `compose.yaml`:\n\n```yaml\nservices:\n db:\n image: postgres\n web:\n build: .\n command: bundle exec rails s -p 3000 -b '0.0.0.0'\n volumes:\n - .:/myapp\n ports:\n - \"3000:3000\"\n depends_on:\n - db\n```\n\nIf you run `docker compose pull ServiceName` in the same directory as the `compose.yaml` file that defines the service, \nDocker pulls the associated image. For example, to call the postgres image configured as the db service in our example, \nyou would run `docker compose pull db`.\n\n```console\n$ docker compose pull db\n[+] Running 1/15\n ⠸ db Pulling 12.4s\n ⠿ 45b42c59be33 Already exists 0.0s\n ⠹ 40adec129f1a Downloading 3.374MB/4.178MB 9.3s\n ⠹ b4c431d00c78 Download complete 9.3s\n ⠹ 2696974e2815 Download complete 9.3s\n ⠹ 564b77596399 Downloading 5.622MB/7.965MB 9.3s\n ⠹ 5044045cf6f2 Downloading 216.7kB/391.1kB 9.3s\n ⠹ d736e67e6ac3 Waiting 9.3s\n ⠹ 390c1c9a5ae4 Waiting 9.3s\n ⠹ c0e62f172284 Waiting 9.3s\n ⠹ ebcdc659c5bf Waiting 9.3s\n ⠹ 29be22cb3acc Waiting 9.3s\n ⠹ f63c47038e66 Waiting 9.3s\n ⠹ 77a0c198cde5 Waiting 9.3s\n ⠹ c8752d5b785c Waiting 9.3s\n``̀" deprecated: false experimental: false experimentalcli: false diff --git a/docs/reference/docker_compose_push.yaml b/docs/reference/docker_compose_push.yaml index f256b1713..1b2a2d516 100644 --- a/docs/reference/docker_compose_push.yaml +++ b/docs/reference/docker_compose_push.yaml @@ -1,6 +1,24 @@ command: docker compose push short: Push service images -long: "Pushes images for services to their respective registry/repository.\n\nThe following assumptions are made:\n- You are pushing an image you have built locally\n- You have access to the build key\n\nExamples\n\n```yaml\nservices:\n service1:\n build: .\n image: localhost:5000/yourimage ## goes to local registry\n \n service2:\n build: .\n image: your-dockerid/yourimage ## goes to your repository on Docker Hub\n```" +long: |- + Pushes images for services to their respective registry/repository. + + The following assumptions are made: + - You are pushing an image you have built locally + - You have access to the build key + + Examples + + ```yaml + services: + service1: + build: . + image: localhost:5000/yourimage ## goes to local registry + + service2: + build: . + image: your-dockerid/yourimage ## goes to your repository on Docker Hub + ``` usage: docker compose push [SERVICE...] pname: docker compose plink: docker_compose.yaml diff --git a/docs/reference/docker_compose_rm.yaml b/docs/reference/docker_compose_rm.yaml index 0615d1789..583a09944 100644 --- a/docs/reference/docker_compose_rm.yaml +++ b/docs/reference/docker_compose_rm.yaml @@ -10,7 +10,7 @@ long: |- Running the command with no options also removes one-off containers created by `docker compose run`: - ``` + ```console $ docker compose rm Going to remove djangoquickstart_web_run_1 Are you sure? [yN] y diff --git a/docs/reference/docker_compose_run.yaml b/docs/reference/docker_compose_run.yaml index c077cc0c8..1f85cbe53 100644 --- a/docs/reference/docker_compose_run.yaml +++ b/docs/reference/docker_compose_run.yaml @@ -1,6 +1,6 @@ command: docker compose run short: Run a one-off command on a service. -long: "Runs a one-time command against a service. \n\nthe following command starts the `web` service and runs `bash` as its command.\n`docker compose run web bash`\n\nCommands you use with run start in new containers with configuration defined by that of the service,\nincluding volumes, links, and other details. However, there are two important differences:\n\nFirst, the command passed by `run` overrides the command defined in the service configuration. For example, if the \n`web` service configuration is started with `bash`, then `docker compose run web python app.py` overrides it with \n`python app.py`.\n\nThe second difference is that the `docker compose run` command does not create any of the ports specified in the \nservice configuration. This prevents port collisions with already-open ports. If you do want the service’s ports \nto be created and mapped to the host, specify the `--service-ports`\n\n```\ndocker compose run --service-ports web python manage.py shell\n```\n\nAlternatively, manual port mapping can be specified with the `--publish` or `-p` options, just as when using docker run:\n\n```\ndocker compose run --publish 8080:80 -p 2022:22 -p 127.0.0.1:2021:21 web python manage.py shell\n```\n\n\nIf you start a service configured with links, the run command first checks to see if the linked service is running \nand starts the service if it is stopped. Once all the linked services are running, the run executes the command you \npassed it. For example, you could run:\n\n```\ndocker compose run db psql -h db -U docker\n```\n\nThis opens an interactive PostgreSQL shell for the linked `db` container.\n\nIf you do not want the run command to start linked containers, use the `--no-deps` flag:\n\n```\ndocker compose run --no-deps web python manage.py shell\n```\n\nIf you want to remove the container after running while overriding the container’s restart policy, use the `--rm` flag:\n\n```\ndocker compose run --rm web python manage.py db upgrade\n```\n\nThis runs a database upgrade script, and removes the container when finished running, even if a restart policy is \nspecified in the service configuration." +long: "Runs a one-time command against a service. \n\nthe following command starts the `web` service and runs `bash` as its command:\n\n```console\n$ docker compose run web bash\n```\n\nCommands you use with run start in new containers with configuration defined by that of the service,\nincluding volumes, links, and other details. However, there are two important differences:\n\nFirst, the command passed by `run` overrides the command defined in the service configuration. For example, if the \n`web` service configuration is started with `bash`, then `docker compose run web python app.py` overrides it with \n`python app.py`.\n\nThe second difference is that the `docker compose run` command does not create any of the ports specified in the \nservice configuration. This prevents port collisions with already-open ports. If you do want the service’s ports \nto be created and mapped to the host, specify the `--service-ports`\n\n```console\n$ docker compose run --service-ports web python manage.py shell\n```\n\nAlternatively, manual port mapping can be specified with the `--publish` or `-p` options, just as when using docker run:\n\n```console\n$ docker compose run --publish 8080:80 -p 2022:22 -p 127.0.0.1:2021:21 web python manage.py shell\n```\n\nIf you start a service configured with links, the run command first checks to see if the linked service is running \nand starts the service if it is stopped. Once all the linked services are running, the run executes the command you \npassed it. For example, you could run:\n\n```console\n$ docker compose run db psql -h db -U docker\n```\n\nThis opens an interactive PostgreSQL shell for the linked `db` container.\n\nIf you do not want the run command to start linked containers, use the `--no-deps` flag:\n\n```console\n$ docker compose run --no-deps web python manage.py shell\n```\n\nIf you want to remove the container after running while overriding the container’s restart policy, use the `--rm` flag:\n\n```console\n$ docker compose run --rm web python manage.py db upgrade\n```\n\nThis runs a database upgrade script, and removes the container when finished running, even if a restart policy is \nspecified in the service configuration." usage: docker compose run [options] [-v VOLUME...] [-p PORT...] [-e KEY=VAL...] [-l KEY=VALUE...] SERVICE [COMMAND] [ARGS...] pname: docker compose plink: docker_compose.yaml diff --git a/docs/reference/docker_compose_top.yaml b/docs/reference/docker_compose_top.yaml index e96a33514..e03493787 100644 --- a/docs/reference/docker_compose_top.yaml +++ b/docs/reference/docker_compose_top.yaml @@ -4,7 +4,7 @@ long: Displays the running processes. usage: docker compose top [SERVICES...] pname: docker compose plink: docker_compose.yaml -examples: "```\n$ docker compose top\nexample_foo_1\nUID PID PPID C STIME TTY TIME CMD\nroot 142353 142331 2 15:33 ? 00:00:00 ping localhost -c 5 \n```" +examples: "```console\n$ docker compose top\nexample_foo_1\nUID PID PPID C STIME TTY TIME CMD\nroot 142353 142331 2 15:33 ? 00:00:00 ping localhost -c 5 \n```" deprecated: false experimental: false experimentalcli: false