Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit b0a6635

Browse files
authored
Merge pull request #1757 from ndeloof/docs
update reference docs
2 parents 45a2c42 + abbba74 commit b0a6635

19 files changed

+138
-15
lines changed

cli/cmd/compose/build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func buildCommand(p *projectOptions, backend compose.Service) *cobra.Command {
6464
}
6565
cmd.Flags().BoolVarP(&opts.quiet, "quiet", "q", false, "Don't print anything to STDOUT")
6666
cmd.Flags().BoolVar(&opts.pull, "pull", false, "Always attempt to pull a newer version of the image.")
67-
cmd.Flags().StringVar(&opts.progress, "progress", "auto", `Set type of progress output ("auto", "plain", "tty")`)
67+
cmd.Flags().StringVar(&opts.progress, "progress", "auto", `Set type of progress output ("auto", "plain", "noTty")`)
6868
cmd.Flags().StringArrayVar(&opts.args, "build-arg", []string{}, "Set build-time variables for services.")
6969
cmd.Flags().Bool("parallel", true, "Build images in parallel. DEPRECATED")
7070
cmd.Flags().MarkHidden("parallel") //nolint:errcheck

cli/cmd/compose/exec.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type execOpts struct {
3636
environment []string
3737
workingDir string
3838

39-
tty bool
39+
noTty bool
4040
user string
4141
detach bool
4242
index int
@@ -68,7 +68,7 @@ func execCommand(p *projectOptions, backend compose.Service) *cobra.Command {
6868
runCmd.Flags().IntVar(&opts.index, "index", 1, "index of the container if there are multiple instances of a service [default: 1].")
6969
runCmd.Flags().BoolVarP(&opts.privileged, "privileged", "", false, "Give extended privileges to the process.")
7070
runCmd.Flags().StringVarP(&opts.user, "user", "u", "", "Run the command as this user.")
71-
runCmd.Flags().BoolVarP(&opts.tty, "", "T", false, "Disable pseudo-tty allocation. By default `docker compose exec` allocates a TTY.")
71+
runCmd.Flags().BoolVarP(&opts.noTty, "", "T", false, "Disable pseudo-TTY allocation. By default `docker compose exec` allocates a TTY.")
7272
runCmd.Flags().StringVarP(&opts.workingDir, "workdir", "w", "", "Path to workdir directory for this command.")
7373

7474
runCmd.Flags().SetInterspersed(false)
@@ -85,7 +85,7 @@ func runExec(ctx context.Context, backend compose.Service, opts execOpts) error
8585
Service: opts.service,
8686
Command: opts.command,
8787
Environment: opts.environment,
88-
Tty: !opts.tty,
88+
Tty: !opts.noTty,
8989
User: opts.user,
9090
Privileged: opts.privileged,
9191
Index: opts.index,

cli/cmd/compose/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func runCommand(p *projectOptions, backend compose.Service) *cobra.Command {
132132
flags.StringArrayVarP(&opts.environment, "env", "e", []string{}, "Set environment variables")
133133
flags.StringArrayVarP(&opts.labels, "labels", "l", []string{}, "Add or override a label")
134134
flags.BoolVar(&opts.Remove, "rm", false, "Automatically remove the container when it exits")
135-
flags.BoolVarP(&opts.noTty, "no-TTY", "T", false, "Disable pseudo-tty allocation. By default docker compose run allocates a TTY")
135+
flags.BoolVarP(&opts.noTty, "no-TTY", "T", false, "Disable pseudo-noTty allocation. By default docker compose run allocates a TTY")
136136
flags.StringVar(&opts.name, "name", "", " Assign a name to the container")
137137
flags.StringVarP(&opts.user, "user", "u", "", "Run as specified username or uid")
138138
flags.StringVarP(&opts.workdir, "workdir", "w", "", "Working directory inside the container")

docs/reference/compose_build.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
## Description
3+
4+
Services are built once and then tagged, by default as `project_service`.
5+
6+
If the Compose file specifies an
7+
[image](https://github.com/compose-spec/compose-spec/blob/master/spec.md#image) name,
8+
the image is tagged with that name, substituting any variables beforehand. See
9+
[variable interpolation](https://github.com/compose-spec/compose-spec/blob/master/spec.md#interpolation).
10+
11+
If you change a service's `Dockerfile` or the contents of its build directory,
12+
run `docker compose build` to rebuild it.

docs/reference/compose_cp.md

Whitespace-only changes.

docs/reference/compose_images.md

Whitespace-only changes.

docs/reference/compose_port.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
## Description
3+
4+
Prints the public port for a port binding.

docs/reference/compose_ps.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11

22
## Description
33

4-
Lists containers for a Compose project.
4+
Lists containers for a Compose project, with current status and exposed ports.
5+
6+
```
7+
$ docker compose ps
8+
NAME SERVICE STATUS PORTS
9+
example_foo_1 foo running (healthy) 0.0.0.0:8000->80/tcp
10+
example_bar_1 bar exited (1)
11+
```

docs/reference/compose_restart.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Restarts all stopped and running services.
2+
3+
If you make changes to your `compose.yml` configuration, these changes are not reflected
4+
after running this command. For example, changes to environment variables (which are added
5+
after a container is built, but before the container's command is executed) are not updated
6+
after restarting.
7+
8+
If you are looking to configure a service's restart policy, please refer to
9+
[restart](https://github.com/compose-spec/compose-spec/blob/master/spec.md#restart)
10+
or [restart_policy](https://github.com/compose-spec/compose-spec/blob/master/deploy.md#restart_policy).

docs/reference/compose_run.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
## Description
23

34
Runs a one-time command against a service.
45

0 commit comments

Comments
 (0)