Flag | Usage |
---|---|
--rm | Remove intermediate containers after a successful build |
-t --tag | Name and optionally tag in the name:tag format |
Flag | Usage |
---|---|
--name myContainer | assign a name to the container |
-P | Publish all exposed ports to the host interfaces |
-p=portSpecification | Publish a container's port/range of ports to the host |
--rm (1, 2) | when the container exits, remove :
|
-v volumeSpecification --volume=volumeSpecification |
bind mount a volume using volumeSpecification : X:Y:Z
|
-w dir --workdir dir | use dir as working directory inside the container |
Flag | Usage |
---|---|
-f formatString --format=formatString |
Format the output using the given Go template (details : 1, 2)
|
.LogPath
}}' containerId/var/lib/docker/containers/containerId_full/containerId_full-json.log
.HostConfig.Binds
}}' containerId[/opt/docker/myApp/myApp.json:/etc/myApp.json:rw]
.State
}}' containerId{running true false false false false 5654 0 2020-09-09T09:49:07.578164883Z 0001-01-01T00:00:00Z <nil>}
{"Status":"running", "Running":true, "Paused":false, "Restarting":false, "OOMKilled":false, "Dead":false, "Pid":5654, "ExitCode":0, "Error":"", "StartedAt":"2020-09-09T09:49:07.578164883Z", "FinishedAt":"0001-01-01T00:00:00Z"}
.State
}}' containerId{running true false false false false 5654 0 2020-09-09T09:49:07.578164883Z 0001-01-01T00:00:00Z <nil>}
{"Status":"running", "Running":true, "Paused":false, "Restarting":false, "OOMKilled":false, "Dead":false, "Pid":5654, "ExitCode":0, "Error":"", "StartedAt":"2020-09-09T09:49:07.578164883Z", "FinishedAt":"0001-01-01T00:00:00Z"}
{ "Dead": false, "Error": "", "ExitCode": 0, "FinishedAt": "0001-01-01T00:00:00Z", "OOMKilled": false, "Paused": false, "Pid": 5654, "Restarting": false, "Running": true, "StartedAt": "2020-09-09T09:49:07.578164883Z", "Status": "running" }
Flag | Usage |
---|---|
-i --interactive | Keep STDIN open even if not attached |
-t --tty | Allocate a pseudo-TTY |
-u --user | specify a username or UID |