mirror of https://github.com/docker/docs.git
Update cloud-ex-machine-ocean.md
This commit is contained in:
parent
b5a42327f2
commit
aab444d99b
|
@ -27,19 +27,19 @@ If you have not done so already, go to <a href="https://digitalocean.com" target
|
|||
|
||||
To generate your access token:
|
||||
|
||||
1. Go to the Digital Ocean administrator console and click **API** in the header.
|
||||
1. Go to the Digital Ocean administrator console and click **API** in the header.
|
||||
|
||||

|
||||
|
||||
2. Click **Generate New Token** to get to the token generator.
|
||||
2. Click **Generate New Token** to get to the token generator.
|
||||
|
||||

|
||||
|
||||
3. Give the token a clever name (e.g. "machine"), make sure the **Write (Optional)** checkbox is checked, and click **Generate Token**.
|
||||
3. Give the token a clever name (e.g. "machine"), make sure the **Write (Optional)** checkbox is checked, and click **Generate Token**.
|
||||
|
||||

|
||||
|
||||
4. Grab (copy to clipboard) the generated big long hex string and store it somewhere safe.
|
||||
4. Grab (copy to clipboard) the generated big long hex string and store it somewhere safe.
|
||||
|
||||

|
||||
|
||||
|
@ -57,19 +57,23 @@ To generate your access token:
|
|||
|
||||
2. At a command terminal, use `docker-machine ls` to get a list of Docker Machines and their status.
|
||||
|
||||
```
|
||||
$ docker-machine ls
|
||||
NAME ACTIVE DRIVER STATE URL SWARM
|
||||
default * virtualbox Running tcp:////xxx.xxx.xx.xxx:xxxx
|
||||
```
|
||||
|
||||
6. Run some Docker commands to make sure that Docker Engine is also up-and-running.
|
||||
|
||||
We'll run `docker run hello-world` again, but you could try `docker ps`, `docker run docker/whalesay cowsay boo`, or another command to verify that Docker is running.
|
||||
|
||||
```
|
||||
$ docker run hello-world
|
||||
|
||||
Hello from Docker.
|
||||
This message shows that your installation appears to be working correctly.
|
||||
...
|
||||
```
|
||||
|
||||
### Step 4. Use Machine to Create the Droplet
|
||||
|
||||
|
@ -77,6 +81,7 @@ To generate your access token:
|
|||
|
||||
For this example, we'll call our new Droplet "docker-sandbox".
|
||||
|
||||
```
|
||||
$ docker-machine create --driver digitalocean --digitalocean-access-token xxxxx docker-sandbox
|
||||
Running pre-create checks...
|
||||
Creating machine...
|
||||
|
@ -92,6 +97,7 @@ To generate your access token:
|
|||
Copying certs to the remote machine...
|
||||
Setting Docker configuration on the remote daemon...
|
||||
To see how to connect Docker to this machine, run: docker-machine env docker-sandbox
|
||||
```
|
||||
|
||||
When the Droplet is created, Docker generates a unique SSH key and stores it on your local system in `~/.docker/machines`. Initially, this is used to provision the host. Later, it's used under the hood to access the Droplet directly with the `docker-machine ssh` command. Docker Engine is installed on the cloud server and the daemon is configured to accept remote connections over TCP using TLS for authentication.
|
||||
|
||||
|
@ -101,15 +107,18 @@ To generate your access token:
|
|||
|
||||
3. At the command terminal, run `docker-machine ls`.
|
||||
|
||||
```
|
||||
$ docker-machine ls
|
||||
NAME ACTIVE DRIVER STATE URL SWARM
|
||||
default * virtualbox Running tcp://192.168.99.100:2376
|
||||
docker-sandbox - digitalocean Running tcp://45.55.139.48:2376
|
||||
```
|
||||
|
||||
Notice that the new cloud server is running but is not the active host. Our command shell is still connected to the default machine, which is currently the active host as indicated by the asterisk (*).
|
||||
|
||||
4. Run `docker-machine env docker-sandbox` to get the environment commands for the new remote host, then run `eval` as directed to re-configure the shell to connect to `docker-sandbox`.
|
||||
|
||||
```
|
||||
$ docker-machine env docker-sandbox
|
||||
export DOCKER_TLS_VERIFY="1"
|
||||
export DOCKER_HOST="tcp://45.55.222.72:2376"
|
||||
|
@ -119,16 +128,20 @@ To generate your access token:
|
|||
# eval "$(docker-machine env docker-sandbox)"
|
||||
|
||||
$ eval "$(docker-machine env docker-sandbox)"
|
||||
```
|
||||
|
||||
5. Re-run `docker-machine ls` to verify that our new server is the active machine, as indicated by the asterisk (*) in the ACTIVE column.
|
||||
|
||||
```
|
||||
$ docker-machine ls
|
||||
NAME ACTIVE DRIVER STATE URL SWARM
|
||||
default - virtualbox Running tcp://192.168.99.100:2376
|
||||
docker-sandbox * digitalocean Running tcp://45.55.222.72:2376
|
||||
```
|
||||
|
||||
6. Run some `docker-machine` commands to inspect the remote host. For example, `docker-machine ip <machine>` gets the host IP address and `docker-machine inspect <machine>` lists all the details.
|
||||
|
||||
```
|
||||
$ docker-machine ip docker-sandbox
|
||||
104.131.43.236
|
||||
|
||||
|
@ -146,6 +159,7 @@ To generate your access token:
|
|||
"SwarmHost": "tcp://0.0.0.0:3376",
|
||||
"SwarmDiscovery": "",
|
||||
...
|
||||
```
|
||||
|
||||
7. Verify Docker Engine is installed correctly by running `docker` commands.
|
||||
|
||||
|
@ -153,6 +167,7 @@ To generate your access token:
|
|||
|
||||
In this example, the `-p` option is used to expose port 80 from the `nginx` container and make it accessible on port `8000` of the `docker-sandbox` host.
|
||||
|
||||
```
|
||||
$ docker run -d -p 8000:80 --name webserver kitematic/hello-world-nginx
|
||||
Unable to find image 'kitematic/hello-world-nginx:latest' locally
|
||||
latest: Pulling from kitematic/hello-world-nginx
|
||||
|
@ -162,6 +177,7 @@ To generate your access token:
|
|||
Digest: sha256:ec0ca6dcb034916784c988b4f2432716e2e92b995ac606e080c7a54b52b87066
|
||||
Status: Downloaded newer image for kitematic/hello-world-nginx:latest
|
||||
942dfb4a0eaae75bf26c9785ade4ff47ceb2ec2a152be82b9d7960e8b5777e65
|
||||
```
|
||||
|
||||
In a web browser, go to `http://<host_ip>:8000` to bring up the webserver home page. You got the `<host_ip>` from the output of the `docker-machine ip <machine>` command you ran in a previous step. Use the port you exposed in the `docker run` command.
|
||||
|
||||
|
|
Loading…
Reference in New Issue