| ... | ... |
@@ -59,8 +59,8 @@ Installing on Ubuntu 12.04 and 12.10 |
| 59 | 59 |
1. Install dependencies: |
| 60 | 60 |
|
| 61 | 61 |
```bash |
| 62 |
- sudo apt-get install lxc wget bsdtar curl |
|
| 63 |
- sudo apt-get install linux-image-extra-`uname -r` |
|
| 62 |
+sudo apt-get install lxc wget bsdtar curl |
|
| 63 |
+sudo apt-get install linux-image-extra-`uname -r` |
|
| 64 | 64 |
``` |
| 65 | 65 |
|
| 66 | 66 |
The `linux-image-extra` package is needed on standard Ubuntu EC2 AMIs in order to install the aufs kernel module. |
| ... | ... |
@@ -68,15 +68,15 @@ The `linux-image-extra` package is needed on standard Ubuntu EC2 AMIs in order t |
| 68 | 68 |
2. Install the latest docker binary: |
| 69 | 69 |
|
| 70 | 70 |
```bash |
| 71 |
- wget http://get.docker.io/builds/$(uname -s)/$(uname -m)/docker-master.tgz |
|
| 72 |
- tar -xf docker-master.tgz |
|
| 71 |
+wget http://get.docker.io/builds/$(uname -s)/$(uname -m)/docker-master.tgz |
|
| 72 |
+tar -xf docker-master.tgz |
|
| 73 | 73 |
``` |
| 74 | 74 |
|
| 75 | 75 |
3. Run your first container! |
| 76 | 76 |
|
| 77 | 77 |
```bash |
| 78 |
- cd docker-master |
|
| 79 |
- sudo ./docker run -a -i -t base /bin/bash |
|
| 78 |
+cd docker-master |
|
| 79 |
+sudo ./docker run -a -i -t base /bin/bash |
|
| 80 | 80 |
``` |
| 81 | 81 |
|
| 82 | 82 |
Consider adding docker to your `PATH` for simplicity. |
| ... | ... |
@@ -99,12 +99,12 @@ with VirtualBox as well as on Amazon EC2. Vagrant 1.1 is required for |
| 99 | 99 |
EC2, but deploying is as simple as: |
| 100 | 100 |
|
| 101 | 101 |
```bash |
| 102 |
- $ export AWS_ACCESS_KEY_ID=xxx \ |
|
| 103 |
- AWS_SECRET_ACCESS_KEY=xxx \ |
|
| 104 |
- AWS_KEYPAIR_NAME=xxx \ |
|
| 105 |
- AWS_SSH_PRIVKEY=xxx |
|
| 106 |
- $ vagrant plugin install vagrant-aws |
|
| 107 |
- $ vagrant up --provider=aws |
|
| 102 |
+$ export AWS_ACCESS_KEY_ID=xxx \ |
|
| 103 |
+ AWS_SECRET_ACCESS_KEY=xxx \ |
|
| 104 |
+ AWS_KEYPAIR_NAME=xxx \ |
|
| 105 |
+ AWS_SSH_PRIVKEY=xxx |
|
| 106 |
+$ vagrant plugin install vagrant-aws |
|
| 107 |
+$ vagrant up --provider=aws |
|
| 108 | 108 |
``` |
| 109 | 109 |
|
| 110 | 110 |
The environment variables are: |
| ... | ... |
@@ -115,11 +115,11 @@ The environment variables are: |
| 115 | 115 |
* `AWS_SSH_PRIVKEY` - The path to the private key for the named keypair |
| 116 | 116 |
|
| 117 | 117 |
For VirtualBox, you can simply ignore setting any of the environment |
| 118 |
-variables and omit the ``provider`` flag. VirtualBox is still supported with |
|
| 119 |
-Vagrant <= 1.1: |
|
| 118 |
+variables and omit the `provider` flag. VirtualBox is still supported with |
|
| 119 |
+Vagrant <= 1.1: |
|
| 120 | 120 |
|
| 121 | 121 |
```bash |
| 122 |
- $ vagrant up |
|
| 122 |
+$ vagrant up |
|
| 123 | 123 |
``` |
| 124 | 124 |
|
| 125 | 125 |
|
| ... | ... |
@@ -131,12 +131,12 @@ Running an interactive shell |
| 131 | 131 |
---------------------------- |
| 132 | 132 |
|
| 133 | 133 |
```bash |
| 134 |
- # Download a base image |
|
| 135 |
- docker import base |
|
| 134 |
+# Download a base image |
|
| 135 |
+docker import base |
|
| 136 | 136 |
|
| 137 |
- # Run an interactive shell in the base image, |
|
| 138 |
- # allocate a tty, attach stdin and stdout |
|
| 139 |
- docker run -a -i -t base /bin/bash |
|
| 137 |
+# Run an interactive shell in the base image, |
|
| 138 |
+# allocate a tty, attach stdin and stdout |
|
| 139 |
+docker run -a -i -t base /bin/bash |
|
| 140 | 140 |
``` |
| 141 | 141 |
|
| 142 | 142 |
|
| ... | ... |
@@ -144,17 +144,17 @@ Starting a long-running worker process |
| 144 | 144 |
-------------------------------------- |
| 145 | 145 |
|
| 146 | 146 |
```bash |
| 147 |
- # Run docker in daemon mode |
|
| 148 |
- (docker -d || echo "Docker daemon already running") & |
|
| 147 |
+# Run docker in daemon mode |
|
| 148 |
+(docker -d || echo "Docker daemon already running") & |
|
| 149 | 149 |
|
| 150 |
- # Start a very useful long-running process |
|
| 151 |
- JOB=$(docker run base /bin/sh -c "while true; do echo Hello world; sleep 1; done") |
|
| 150 |
+# Start a very useful long-running process |
|
| 151 |
+JOB=$(docker run base /bin/sh -c "while true; do echo Hello world; sleep 1; done") |
|
| 152 | 152 |
|
| 153 |
- # Collect the output of the job so far |
|
| 154 |
- docker logs $JOB |
|
| 153 |
+# Collect the output of the job so far |
|
| 154 |
+docker logs $JOB |
|
| 155 | 155 |
|
| 156 |
- # Kill the job |
|
| 157 |
- docker kill $JOB |
|
| 156 |
+# Kill the job |
|
| 157 |
+docker kill $JOB |
|
| 158 | 158 |
``` |
| 159 | 159 |
|
| 160 | 160 |
|
| ... | ... |
@@ -162,7 +162,7 @@ Listing all running containers |
| 162 | 162 |
------------------------------ |
| 163 | 163 |
|
| 164 | 164 |
```bash |
| 165 |
- docker ps |
|
| 165 |
+docker ps |
|
| 166 | 166 |
``` |
| 167 | 167 |
|
| 168 | 168 |
|
| ... | ... |
@@ -170,17 +170,17 @@ Expose a service on a TCP port |
| 170 | 170 |
------------------------------ |
| 171 | 171 |
|
| 172 | 172 |
```bash |
| 173 |
- # Expose port 4444 of this container, and tell netcat to listen on it |
|
| 174 |
- JOB=$(docker run -p 4444 base /bin/nc -l -p 4444) |
|
| 173 |
+# Expose port 4444 of this container, and tell netcat to listen on it |
|
| 174 |
+JOB=$(docker run -p 4444 base /bin/nc -l -p 4444) |
|
| 175 | 175 |
|
| 176 |
- # Which public port is NATed to my container? |
|
| 177 |
- PORT=$(docker port $JOB 4444) |
|
| 176 |
+# Which public port is NATed to my container? |
|
| 177 |
+PORT=$(docker port $JOB 4444) |
|
| 178 | 178 |
|
| 179 |
- # Connect to the public port via the host's public address |
|
| 180 |
- echo hello world | nc $(hostname) $PORT |
|
| 179 |
+# Connect to the public port via the host's public address |
|
| 180 |
+echo hello world | nc $(hostname) $PORT |
|
| 181 | 181 |
|
| 182 |
- # Verify that the network connection worked |
|
| 183 |
- echo "Daemon received: $(docker logs $JOB)" |
|
| 182 |
+# Verify that the network connection worked |
|
| 183 |
+echo "Daemon received: $(docker logs $JOB)" |
|
| 184 | 184 |
``` |
| 185 | 185 |
|
| 186 | 186 |
Contributing to Docker |
| ... | ... |
@@ -226,7 +226,7 @@ Setting up a dev environment |
| 226 | 226 |
|
| 227 | 227 |
Instructions that is verified to work on Ubuntu 12.10, |
| 228 | 228 |
|
| 229 |
-``` |
|
| 229 |
+```bash |
|
| 230 | 230 |
sudo apt-get -y install lxc wget bsdtar curl libsqlite3-dev golang git pkg-config |
| 231 | 231 |
|
| 232 | 232 |
export GOPATH=~/go/ |
| ... | ... |
@@ -243,7 +243,7 @@ go install -v github.com/dotcloud/docker/... |
| 243 | 243 |
|
| 244 | 244 |
Then run the docker daemon, |
| 245 | 245 |
|
| 246 |
-``` |
|
| 246 |
+```bash |
|
| 247 | 247 |
sudo $GOPATH/bin/docker -d |
| 248 | 248 |
``` |
| 249 | 249 |
|