Markdown: fix some code-hints

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2020-03-17 13:23:02 +01:00
parent 14bbe621e5
commit 19c6cb8f1c
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
22 changed files with 105 additions and 63 deletions

View File

@ -116,7 +116,7 @@ and `raw`.
The default format is `inline` where each log message is embedded as a string. The default format is `inline` where each log message is embedded as a string.
For example: For example:
```none ```json
{ {
"attrs": { "attrs": {
"env1": "val1", "env1": "val1",
@ -126,6 +126,8 @@ For example:
"source": "stdout", "source": "stdout",
"line": "my message" "line": "my message"
} }
```
```json
{ {
"attrs": { "attrs": {
"env1": "val1", "env1": "val1",
@ -144,7 +146,7 @@ To format messages as `json` objects, set `--log-opt splunk-format=json`. The
driver trys to parse every line as a JSON object and send it as an embedded driver trys to parse every line as a JSON object and send it as an embedded
object. If it cannot parse the message, it is sent `inline`. For example: object. If it cannot parse the message, it is sent `inline`. For example:
```none ```json
{ {
"attrs": { "attrs": {
"env1": "val1", "env1": "val1",
@ -154,6 +156,8 @@ object. If it cannot parse the message, it is sent `inline`. For example:
"source": "stdout", "source": "stdout",
"line": "my message" "line": "my message"
} }
```
```json
{ {
"attrs": { "attrs": {
"env1": "val1", "env1": "val1",
@ -182,7 +186,7 @@ Splunk Logging Driver allows you to configure few advanced options by specifying
| Environment variable name | Default value | Description | | Environment variable name | Default value | Description |
|:-------------------------------------------------|:--------------|:---------------------------------------------------------------------------------------------------------------------------------------------------| |:-------------------------------------------------|:--------------|:---------------------------------------------------------------------------------------------------------------------------------------------------|
| `SPLUNK_LOGGING_DRIVER_POST_MESSAGES_FREQUENCY` | `5s` | If there is nothing to batch how often driver posts messages. You can think about this as the maximum time to wait for more messages to batch. | | `SPLUNK_LOGGING_DRIVER_POST_MESSAGES_FREQUENCY` | `5s` | If there is nothing to batch how often driver posts messages. You can think about this as the maximum time to wait for more messages to batch. |
| `SPLUNK_LOGGING_DRIVER_POST_MESSAGES_BATCH_SIZE` | `1000` | How many messages driver should wait before sending them in one batch. | | `SPLUNK_LOGGING_DRIVER_POST_MESSAGES_BATCH_SIZE` | `1000` | How many messages driver should wait before sending them in one batch. |
| `SPLUNK_LOGGING_DRIVER_BUFFER_MAX` | `10 * 1000` | If driver cannot connect to remote server, what is the maximum amount of messages it can hold in buffer for retries. | | `SPLUNK_LOGGING_DRIVER_BUFFER_MAX` | `10 * 1000` | If driver cannot connect to remote server, what is the maximum amount of messages it can hold in buffer for retries. |
| `SPLUNK_LOGGING_DRIVER_CHANNEL_SIZE` | `4 * 1000` | How many pending messages can be in the channel which is used to send messages to background logger worker, which batches them. | | `SPLUNK_LOGGING_DRIVER_CHANNEL_SIZE` | `4 * 1000` | How many pending messages can be in the channel which is used to send messages to background logger worker, which batches them. |

View File

@ -8,7 +8,7 @@ hide_from_sitemap: true
See which machine is "active" (a machine is considered active if the See which machine is "active" (a machine is considered active if the
`DOCKER_HOST` environment variable points to it). `DOCKER_HOST` environment variable points to it).
```none ```bash
$ docker-machine ls $ docker-machine ls
NAME ACTIVE DRIVER STATE URL NAME ACTIVE DRIVER STATE URL
@ -20,4 +20,4 @@ tcp://203.0.113.81:2376
$ docker-machine active $ docker-machine active
staging staging
``` ```

View File

@ -20,11 +20,11 @@ Options:
For example: For example:
```none ```bash
$ docker-machine config dev \ $ docker-machine config dev \
--tlsverify \ --tlsverify \
--tlscacert="/Users/ehazlett/.docker/machines/dev/ca.pem" \ --tlscacert="/Users/ehazlett/.docker/machines/dev/ca.pem" \
--tlscert="/Users/ehazlett/.docker/machines/dev/cert.pem" \ --tlscert="/Users/ehazlett/.docker/machines/dev/cert.pem" \
--tlskey="/Users/ehazlett/.docker/machines/dev/key.pem" \ --tlskey="/Users/ehazlett/.docker/machines/dev/key.pem" \
-H tcp://192.168.99.103:2376 -H tcp://192.168.99.103:2376
``` ```

View File

@ -19,8 +19,9 @@ drivers](/machine/drivers/index.md).
Here is an example of using the `--virtualbox` driver to create a machine called `dev`. Here is an example of using the `--virtualbox` driver to create a machine called `dev`.
```none ```bash
$ docker-machine create --driver virtualbox dev $ docker-machine create --driver virtualbox dev
Creating CA: /home/username/.docker/machine/certs/ca.pem Creating CA: /home/username/.docker/machine/certs/ca.pem
Creating client certificate: /home/username/.docker/machine/certs/cert.pem Creating client certificate: /home/username/.docker/machine/certs/cert.pem
Image cache does not exist, creating it at /home/username/.docker/machine/cache... Image cache does not exist, creating it at /home/username/.docker/machine/cache...
@ -40,8 +41,9 @@ drivers. These largely control aspects of Machine's provisioning process
(including the creation of Docker Swarm containers) that the user may wish to (including the creation of Docker Swarm containers) that the user may wish to
customize. customize.
```none ```bash
$ docker-machine create $ docker-machine create
Docker Machine Version: 0.5.0 (45e3688) Docker Machine Version: 0.5.0 (45e3688)
Usage: docker-machine create [OPTIONS] [arg...] Usage: docker-machine create [OPTIONS] [arg...]
@ -78,7 +80,7 @@ geographical region (`--amazonec2-region us-west-1`), and so on.
To see the provider-specific flags, simply pass a value for `--driver` when To see the provider-specific flags, simply pass a value for `--driver` when
invoking the `create` help text. invoking the `create` help text.
```none ```bash
$ docker-machine create --driver virtualbox --help $ docker-machine create --driver virtualbox --help
Usage: docker-machine create [OPTIONS] [arg...] Usage: docker-machine create [OPTIONS] [arg...]
@ -147,7 +149,7 @@ filesystem has been created, and so on.
The following is an example usage: The following is an example usage:
```none ```bash
$ docker-machine create -d virtualbox \ $ docker-machine create -d virtualbox \
--engine-label foo=bar \ --engine-label foo=bar \
--engine-label spam=eggs \ --engine-label spam=eggs \
@ -162,9 +164,10 @@ labels on the engine, and allows pushing / pulling from the insecure registry
located at `registry.myco.com`. You can verify much of this by inspecting the located at `registry.myco.com`. You can verify much of this by inspecting the
output of `docker info`: output of `docker info`:
```none ```bash
$ eval $(docker-machine env foobarmachine) $ eval $(docker-machine env foobarmachine)
$ docker info $ docker info
Containers: 0 Containers: 0
Images: 0 Images: 0
Storage Driver: overlay Storage Driver: overlay
@ -195,7 +198,7 @@ for all containers, and always use the `syslog` [log
driver](/engine/reference/run.md#logging-drivers-log-driver) you driver](/engine/reference/run.md#logging-drivers-log-driver) you
could run the following create command: could run the following create command:
```none ```bash
$ docker-machine create -d virtualbox \ $ docker-machine create -d virtualbox \
--engine-opt dns=8.8.8.8 \ --engine-opt dns=8.8.8.8 \
--engine-opt log-driver=syslog \ --engine-opt log-driver=syslog \
@ -205,11 +208,13 @@ $ docker-machine create -d virtualbox \
Additionally, Docker Machine supports a flag, `--engine-env`, which can be used to Additionally, Docker Machine supports a flag, `--engine-env`, which can be used to
specify arbitrary environment variables to be set within the engine with the syntax `--engine-env name=value`. For example, to specify that the engine should use `example.com` as the proxy server, you could run the following create command: specify arbitrary environment variables to be set within the engine with the syntax `--engine-env name=value`. For example, to specify that the engine should use `example.com` as the proxy server, you could run the following create command:
$ docker-machine create -d virtualbox \ ```bash
--engine-env HTTP_PROXY=http://example.com:8080 \ $ docker-machine create -d virtualbox \
--engine-env HTTPS_PROXY=https://example.com:8080 \ --engine-env HTTP_PROXY=http://example.com:8080 \
--engine-env NO_PROXY=example2.com \ --engine-env HTTPS_PROXY=https://example.com:8080 \
proxbox --engine-env NO_PROXY=example2.com \
proxbox
```
## Specifying Docker Swarm options for the created machine ## Specifying Docker Swarm options for the created machine
@ -232,7 +237,7 @@ you don't need to worry about it.
Example create: Example create:
```none ```bash
$ docker-machine create -d virtualbox \ $ docker-machine create -d virtualbox \
--swarm \ --swarm \
--swarm-master \ --swarm-master \

View File

@ -8,7 +8,7 @@ hide_from_sitemap: true
Set environment variables to dictate that `docker` should run a command against Set environment variables to dictate that `docker` should run a command against
a particular machine. a particular machine.
```none ```bash
$ docker-machine env --help $ docker-machine env --help
Usage: docker-machine env [OPTIONS] [arg...] Usage: docker-machine env [OPTIONS] [arg...]
@ -30,10 +30,11 @@ Options:
run in a subshell. Running `docker-machine env -u` prints `unset` commands run in a subshell. Running `docker-machine env -u` prints `unset` commands
which reverse this effect. which reverse this effect.
```none ```bash
$ env | grep DOCKER $ env | grep DOCKER
$ eval "$(docker-machine env dev)" $ eval "$(docker-machine env dev)"
$ env | grep DOCKER $ env | grep DOCKER
DOCKER_HOST=tcp://192.168.99.101:2376 DOCKER_HOST=tcp://192.168.99.101:2376
DOCKER_CERT_PATH=/Users/nathanleclaire/.docker/machines/.client DOCKER_CERT_PATH=/Users/nathanleclaire/.docker/machines/.client
DOCKER_TLS_VERIFY=1 DOCKER_TLS_VERIFY=1
@ -54,7 +55,7 @@ If you are using `fish` and the `SHELL` environment variable is correctly set to
the path where `fish` is located, `docker-machine env name` prints out the the path where `fish` is located, `docker-machine env name` prints out the
values in the format which `fish` expects: values in the format which `fish` expects:
```none ```fish
set -x DOCKER_TLS_VERIFY 1; set -x DOCKER_TLS_VERIFY 1;
set -x DOCKER_CERT_PATH "/Users/nathanleclaire/.docker/machine/machines/overlay"; set -x DOCKER_CERT_PATH "/Users/nathanleclaire/.docker/machine/machines/overlay";
set -x DOCKER_HOST tcp://192.168.99.102:2376; set -x DOCKER_HOST tcp://192.168.99.102:2376;
@ -69,8 +70,9 @@ If you are on Windows and using either PowerShell or `cmd.exe`, `docker-machine
For PowerShell: For PowerShell:
```none ```bash
$ docker-machine.exe env --shell powershell dev $ docker-machine.exe env --shell powershell dev
$Env:DOCKER_TLS_VERIFY = "1" $Env:DOCKER_TLS_VERIFY = "1"
$Env:DOCKER_HOST = "tcp://192.168.99.101:2376" $Env:DOCKER_HOST = "tcp://192.168.99.101:2376"
$Env:DOCKER_CERT_PATH = "C:\Users\captain\.docker\machine\machines\dev" $Env:DOCKER_CERT_PATH = "C:\Users\captain\.docker\machine\machines\dev"
@ -81,8 +83,9 @@ $Env:DOCKER_MACHINE_NAME = "dev"
For `cmd.exe`: For `cmd.exe`:
```none ```bash
$ docker-machine.exe env --shell cmd dev $ docker-machine.exe env --shell cmd dev
set DOCKER_TLS_VERIFY=1 set DOCKER_TLS_VERIFY=1
set DOCKER_HOST=tcp://192.168.99.101:2376 set DOCKER_HOST=tcp://192.168.99.101:2376
set DOCKER_CERT_PATH=C:\Users\captain\.docker\machine\machines\dev set DOCKER_CERT_PATH=C:\Users\captain\.docker\machine\machines\dev
@ -102,8 +105,9 @@ This is useful when using `docker-machine` with a local VM provider, such as
`virtualbox` or `vmwarefusion`, in network environments where an HTTP proxy is `virtualbox` or `vmwarefusion`, in network environments where an HTTP proxy is
required for internet access. required for internet access.
```none ```bash
$ docker-machine env --no-proxy default $ docker-machine env --no-proxy default
export DOCKER_TLS_VERIFY="1" export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.104:2376" export DOCKER_HOST="tcp://192.168.99.104:2376"
export DOCKER_CERT_PATH="/Users/databus23/.docker/machine/certs" export DOCKER_CERT_PATH="/Users/databus23/.docker/machine/certs"

View File

@ -15,8 +15,9 @@ Usage: docker-machine help _subcommand_
For example: For example:
```none ```bash
$ docker-machine help config $ docker-machine help config
Usage: docker-machine config [OPTIONS] [arg...] Usage: docker-machine config [OPTIONS] [arg...]
Print the connection config for machine Print the connection config for machine

View File

@ -32,7 +32,7 @@ In addition to the `text/template` syntax, there are some additional functions,
This is the default usage of `inspect`. This is the default usage of `inspect`.
```none ```bash
$ docker-machine inspect dev $ docker-machine inspect dev
{ {
@ -55,8 +55,9 @@ For the most part, you can pick out any field from the JSON in a fairly
straightforward manner. straightforward manner.
{% raw %} {% raw %}
```none ```bash
$ docker-machine inspect --format='{{.Driver.IPAddress}}' dev $ docker-machine inspect --format='{{.Driver.IPAddress}}' dev
192.168.5.99 192.168.5.99
``` ```
{% endraw %} {% endraw %}
@ -66,8 +67,9 @@ $ docker-machine inspect --format='{{.Driver.IPAddress}}' dev
If you want a subset of information formatted as JSON, you can use the `json` If you want a subset of information formatted as JSON, you can use the `json`
function in the template. function in the template.
```none ```bash
$ docker-machine inspect --format='{{json .Driver}}' dev-fusion $ docker-machine inspect --format='{{json .Driver}}' dev-fusion
{"Boot2DockerURL":"","CPUS":8,"CPUs":8,"CaCertPath":"/Users/hairyhenderson/.docker/machine/certs/ca.pem","DiskSize":20000,"IPAddress":"172.16.62.129","ISO":"/Users/hairyhenderson/.docker/machine/machines/dev-fusion/boot2docker-1.5.0-GH747.iso","MachineName":"dev-fusion","Memory":1024,"PrivateKeyPath":"/Users/hairyhenderson/.docker/machine/certs/ca-key.pem","SSHPort":22,"SSHUser":"docker","SwarmDiscovery":"","SwarmHost":"tcp://0.0.0.0:3376","SwarmMaster":false} {"Boot2DockerURL":"","CPUS":8,"CPUs":8,"CaCertPath":"/Users/hairyhenderson/.docker/machine/certs/ca.pem","DiskSize":20000,"IPAddress":"172.16.62.129","ISO":"/Users/hairyhenderson/.docker/machine/machines/dev-fusion/boot2docker-1.5.0-GH747.iso","MachineName":"dev-fusion","Memory":1024,"PrivateKeyPath":"/Users/hairyhenderson/.docker/machine/certs/ca-key.pem","SSHPort":22,"SSHUser":"docker","SwarmDiscovery":"","SwarmHost":"tcp://0.0.0.0:3376","SwarmMaster":false}
``` ```
@ -75,8 +77,9 @@ While this is usable, it's not very human-readable. For this reason, there is
`prettyjson`: `prettyjson`:
{% raw %} {% raw %}
```none ```bash
$ docker-machine inspect --format='{{prettyjson .Driver}}' dev-fusion $ docker-machine inspect --format='{{prettyjson .Driver}}' dev-fusion
{ {
"Boot2DockerURL": "", "Boot2DockerURL": "",
"CPUS": 8, "CPUS": 8,

View File

@ -7,11 +7,13 @@ hide_from_sitemap: true
Get the IP address of one or more machines. Get the IP address of one or more machines.
```none ```bash
$ docker-machine ip dev $ docker-machine ip dev
192.168.99.104 192.168.99.104
$ docker-machine ip dev dev2 $ docker-machine ip dev dev2
192.168.99.104 192.168.99.104
192.168.99.105 192.168.99.105
``` ```

View File

@ -16,12 +16,15 @@ Description:
For example: For example:
```none ```bash
$ docker-machine ls $ docker-machine ls
NAME ACTIVE DRIVER STATE URL NAME ACTIVE DRIVER STATE URL
dev * virtualbox Running tcp://192.168.99.104:2376 dev * virtualbox Running tcp://192.168.99.104:2376
$ docker-machine kill dev $ docker-machine kill dev
$ docker-machine ls $ docker-machine ls
NAME ACTIVE DRIVER STATE URL NAME ACTIVE DRIVER STATE URL
dev * virtualbox Stopped dev * virtualbox Stopped
``` ```

View File

@ -13,7 +13,7 @@ The notation is `machinename:/path/to/dir` for the argument; you can also supply
Consider the following example: Consider the following example:
```none ```bash
$ mkdir foo $ mkdir foo
$ docker-machine ssh dev mkdir foo $ docker-machine ssh dev mkdir foo
$ docker-machine mount dev:/home/docker/foo foo $ docker-machine mount dev:/home/docker/foo foo
@ -26,7 +26,7 @@ bar
Now you can use the directory on the machine, for mounting into containers. Now you can use the directory on the machine, for mounting into containers.
Any changes done in the local directory, is reflected in the machine too. Any changes done in the local directory, is reflected in the machine too.
```none ```bash
$ eval $(docker-machine env dev) $ eval $(docker-machine env dev)
$ docker run -v /home/docker/foo:/tmp/foo busybox ls /tmp/foo $ docker run -v /home/docker/foo:/tmp/foo busybox ls /tmp/foo
bar bar
@ -43,7 +43,7 @@ so this program ("sftp") needs to be present on the machine - but it usually is.
To unmount the directory again, you can use the same options but the `-u` flag. To unmount the directory again, you can use the same options but the `-u` flag.
You can also call `fuserunmount` (or `fusermount -u`) commands directly. You can also call `fuserunmount` (or `fusermount -u`) commands directly.
```none ```bash
$ docker-machine mount -u dev:/home/docker/foo foo $ docker-machine mount -u dev:/home/docker/foo foo
$ rmdir foo $ rmdir foo
``` ```

View File

@ -14,7 +14,7 @@ originally specified Swarm or Engine configuration).
Usage is `docker-machine provision [name]`. Multiple names may be specified. Usage is `docker-machine provision [name]`. Multiple names may be specified.
```none ```bash
$ docker-machine provision foo bar $ docker-machine provision foo bar
Copying certs to the local machine directory... Copying certs to the local machine directory...

View File

@ -23,7 +23,7 @@ Regenerate TLS certificates and update the machine with new certs.
For example: For example:
```none ```bash
$ docker-machine regenerate-certs dev $ docker-machine regenerate-certs dev
Regenerate TLS machine certs? Warning: this is irreversible. (y/n): y Regenerate TLS machine certs? Warning: this is irreversible. (y/n): y
@ -33,8 +33,9 @@ Regenerating TLS certificates
If your certificates have expired, you'll need to regenerate the client certs If your certificates have expired, you'll need to regenerate the client certs
as well using the `--client-certs` option: as well using the `--client-certs` option:
```none ```bash
$ docker-machine regenerate-certs --client-certs dev $ docker-machine regenerate-certs --client-certs dev
Regenerate TLS machine certs? Warning: this is irreversible. (y/n): y Regenerate TLS machine certs? Warning: this is irreversible. (y/n): y
Regenerating TLS certificates Regenerating TLS certificates
Regenerating local certificates Regenerating local certificates

View File

@ -18,7 +18,8 @@ Restart a machine. Oftentimes this is equivalent to
`docker-machine stop; docker-machine start`. But some cloud driver try to implement a clever restart which keeps the same `docker-machine stop; docker-machine start`. But some cloud driver try to implement a clever restart which keeps the same
IP address. IP address.
``` ```bash
$ docker-machine restart dev $ docker-machine restart dev
Waiting for VM to start... Waiting for VM to start...
``` ```

View File

@ -8,7 +8,7 @@ hide_from_sitemap: true
Remove a machine. This removes the local reference and deletes it Remove a machine. This removes the local reference and deletes it
on the cloud provider or virtualization management platform. on the cloud provider or virtualization management platform.
```none ```bash
$ docker-machine rm --help $ docker-machine rm --help
Usage: docker-machine rm [OPTIONS] [arg...] Usage: docker-machine rm [OPTIONS] [arg...]
@ -26,8 +26,9 @@ Options:
## Examples ## Examples
```none ```bash
$ docker-machine ls $ docker-machine ls
NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS
bar - virtualbox Running tcp://192.168.99.101:2376 v1.9.1 bar - virtualbox Running tcp://192.168.99.101:2376 v1.9.1
baz - virtualbox Running tcp://192.168.99.103:2376 v1.9.1 baz - virtualbox Running tcp://192.168.99.103:2376 v1.9.1
@ -36,12 +37,14 @@ qix - virtualbox Running tcp://192.168.99.102:2376 v1.9.
$ docker-machine rm baz $ docker-machine rm baz
About to remove baz About to remove baz
Are you sure? (y/n): y Are you sure? (y/n): y
Successfully removed baz Successfully removed baz
$ docker-machine ls $ docker-machine ls
NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS
bar - virtualbox Running tcp://192.168.99.101:2376 v1.9.1 bar - virtualbox Running tcp://192.168.99.101:2376 v1.9.1
foo - virtualbox Running tcp://192.168.99.100:2376 v1.9.1 foo - virtualbox Running tcp://192.168.99.100:2376 v1.9.1
@ -49,6 +52,7 @@ qix - virtualbox Running tcp://192.168.99.102:2376 v1.9.
$ docker-machine rm bar qix $ docker-machine rm bar qix
About to remove bar, qix About to remove bar, qix
Are you sure? (y/n): y Are you sure? (y/n): y
Successfully removed bar Successfully removed bar
@ -56,10 +60,12 @@ Successfully removed qix
$ docker-machine ls $ docker-machine ls
NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS
foo - virtualbox Running tcp://192.168.99.100:2376 v1.9.1 foo - virtualbox Running tcp://192.168.99.100:2376 v1.9.1
$ docker-machine rm -y foo $ docker-machine rm -y foo
About to remove foo About to remove foo
Successfully removed foo Successfully removed foo
``` ```

View File

@ -15,11 +15,13 @@ machine's case, you don't need to specify the name, just the path.
Consider the following example: Consider the following example:
```none ```bash
$ cat foo.txt $ cat foo.txt
cat: foo.txt: No such file or directory cat: foo.txt: No such file or directory
$ docker-machine ssh dev pwd $ docker-machine ssh dev pwd
/home/docker /home/docker
$ docker-machine ssh dev 'echo A file created remotely! >foo.txt' $ docker-machine ssh dev 'echo A file created remotely! >foo.txt'
$ docker-machine scp dev:/home/docker/foo.txt . $ docker-machine scp dev:/home/docker/foo.txt .
foo.txt 100% 28 0.0KB/s 00:00 foo.txt 100% 28 0.0KB/s 00:00
@ -40,7 +42,7 @@ transferring all of the files.
When transferring directories and not just files, avoid rsync surprises When transferring directories and not just files, avoid rsync surprises
by using trailing slashes on both the source and destination. For example: by using trailing slashes on both the source and destination. For example:
```none ```bash
$ mkdir -p bar $ mkdir -p bar
$ touch bar/baz $ touch bar/baz
$ docker-machine scp -r -d bar/ dev:/home/docker/bar/ $ docker-machine scp -r -d bar/ dev:/home/docker/bar/
@ -61,7 +63,7 @@ For example, imagine you want to transfer your local directory
container on the remote host. If the remote user is `ubuntu`, use a command like container on the remote host. If the remote user is `ubuntu`, use a command like
this: this:
```none ```bash
$ docker-machine scp -r /Users/<username>/webapp MACHINE-NAME:/home/ubuntu/webapp $ docker-machine scp -r /Users/<username>/webapp MACHINE-NAME:/home/ubuntu/webapp
``` ```
@ -79,7 +81,7 @@ services:
And we can try it out like so: And we can try it out like so:
```none ```bash
$ eval $(docker-machine env MACHINE-NAME) $ eval $(docker-machine env MACHINE-NAME)
$ docker-compose run webapp $ docker-compose run webapp
``` ```

View File

@ -9,8 +9,9 @@ Log into or run a command on a machine using SSH.
To login, just run `docker-machine ssh machinename`: To login, just run `docker-machine ssh machinename`:
```none ```bash
$ docker-machine ssh dev $ docker-machine ssh dev
## . ## .
## ## ## == ## ## ## ==
## ## ## ## === ## ## ## ## ===
@ -34,7 +35,7 @@ bin/ etc/ init linuxrc opt/ root/ sbin/ tmp var/
You can also specify commands to run remotely by appending them directly to the You can also specify commands to run remotely by appending them directly to the
`docker-machine ssh` command, much like the regular `ssh` program works: `docker-machine ssh` command, much like the regular `ssh` program works:
```none ```bash
$ docker-machine ssh dev free $ docker-machine ssh dev free
total used free shared buffers total used free shared buffers
@ -45,7 +46,7 @@ Swap: 1212036 0 1212036
Commands with flags work as well: Commands with flags work as well:
```none ```bash
$ docker-machine ssh dev df -h $ docker-machine ssh dev df -h
Filesystem Size Used Available Use% Mounted on Filesystem Size Used Available Use% Mounted on

View File

@ -17,7 +17,8 @@ Description:
For example: For example:
```none ```bash
$ docker-machine start dev $ docker-machine start dev
Starting VM... Starting VM...
``` ```

View File

@ -16,7 +16,8 @@ Description:
For example: For example:
``` ```bash
$ docker-machine status dev $ docker-machine status dev
Running Running
``` ```

View File

@ -16,7 +16,7 @@ Description:
For example: For example:
```none ```bash
$ docker-machine ls $ docker-machine ls
NAME ACTIVE DRIVER STATE URL NAME ACTIVE DRIVER STATE URL

View File

@ -15,7 +15,7 @@ example, if the machine uses boot2docker for its OS, this command downloads
the latest boot2docker ISO and replace the machine's existing ISO with the the latest boot2docker ISO and replace the machine's existing ISO with the
latest. latest.
```none ```bash
$ docker-machine upgrade default $ docker-machine upgrade default
Stopping machine to do the upgrade... Stopping machine to do the upgrade...

View File

@ -7,7 +7,8 @@ hide_from_sitemap: true
Get the URL of a host Get the URL of a host
```none ```bash
$ docker-machine url dev $ docker-machine url dev
tcp://192.168.99.109:2376 tcp://192.168.99.109:2376
``` ```

View File

@ -68,8 +68,9 @@ Daemon running on each node. Other discovery service backends such as
haven't got the `swarm:latest` image on your local machine, Docker pulls it haven't got the `swarm:latest` image on your local machine, Docker pulls it
for you. for you.
```none ```console
$ docker run swarm create $ docker run swarm create
Unable to find image 'swarm:latest' locally Unable to find image 'swarm:latest' locally
latest: Pulling from swarm latest: Pulling from swarm
de939d6ed512: Pull complete de939d6ed512: Pull complete
@ -122,8 +123,9 @@ In this section, you create a swarm manager and two nodes.
For example: For example:
```none ```console
$ docker-machine create -d virtualbox --swarm --swarm-master --swarm-discovery token://fe0cc96a72cf04dba8c1c4aa79536ec3 swarm-master $ docker-machine create -d virtualbox --swarm --swarm-master --swarm-discovery token://fe0cc96a72cf04dba8c1c4aa79536ec3 swarm-master
INFO[0000] Creating SSH key... INFO[0000] Creating SSH key...
INFO[0000] Creating VirtualBox VM... INFO[0000] Creating VirtualBox VM...
INFO[0005] Starting VirtualBox VM... INFO[0005] Starting VirtualBox VM...
@ -184,6 +186,7 @@ your swarm, and start an image on your swarm.
```bash ```bash
$ docker info $ docker info
Containers: 4 Containers: 4
Strategy: spread Strategy: spread
Filters: affinity, health, constraint, port, dependency Filters: affinity, health, constraint, port, dependency
@ -207,8 +210,9 @@ your swarm, and start an image on your swarm.
3. Check the images currently running on your swarm. 3. Check the images currently running on your swarm.
```none ```console
$ docker ps -a $ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
78be991b58d1 swarm:latest "/swarm join --addr 3 minutes ago Up 2 minutes 2375/tcp swarm-agent-01/swarm-agent 78be991b58d1 swarm:latest "/swarm join --addr 3 minutes ago Up 2 minutes 2375/tcp swarm-agent-01/swarm-agent
da5127e4f0f9 swarm:latest "/swarm join --addr 6 minutes ago Up 6 minutes 2375/tcp swarm-agent-00/swarm-agent da5127e4f0f9 swarm:latest "/swarm join --addr 6 minutes ago Up 6 minutes 2375/tcp swarm-agent-00/swarm-agent
@ -220,6 +224,7 @@ your swarm, and start an image on your swarm.
```bash ```bash
$ docker run hello-world $ docker run hello-world
Hello from Docker. Hello from Docker.
This message shows that your installation appears to be working correctly. This message shows that your installation appears to be working correctly.
@ -245,6 +250,7 @@ your swarm, and start an image on your swarm.
```bash ```bash
$ docker ps -a $ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
54a8690043dd hello-world:latest "/hello" 22 seconds ago Exited (0) 3 seconds ago swarm-agent-00/modest_goodall 54a8690043dd hello-world:latest "/hello" 22 seconds ago Exited (0) 3 seconds ago swarm-agent-00/modest_goodall
78be991b58d1 swarm:latest "/swarm join --addr 5 minutes ago Up 4 minutes 2375/tcp swarm-agent-01/swarm-agent 78be991b58d1 swarm:latest "/swarm join --addr 5 minutes ago Up 4 minutes 2375/tcp swarm-agent-01/swarm-agent