Browse code

Add examples to the README

Solomon Hykes authored on 2013/04/19 14:24:29
Showing 1 changed files
... ...
@@ -144,12 +144,11 @@ Throwaway shell in a base ubuntu image
144 144
 --------------------------------------
145 145
 
146 146
 ```bash
147
-# Download a base image
148
-docker pull base
147
+docker pull ubuntu:12.10
149 148
 
150
-# Run an interactive shell in the base image,
149
+# Run an interactive shell
151 150
 # allocate a tty, attach stdin and stdout
152
-docker run -i -t base /bin/bash
151
+docker run -i -t ubuntu:12.10 /bin/bash
153 152
 ```
154 153
 
155 154
 Detaching from the interactive shell
... ...
@@ -164,7 +163,7 @@ Starting a long-running worker process
164 164
 
165 165
 ```bash
166 166
 # Start a very useful long-running process
167
-JOB=$(docker run -d base /bin/sh -c "while true; do echo Hello world; sleep 1; done")
167
+JOB=$(docker run -d ubuntu /bin/sh -c "while true; do echo Hello world; sleep 1; done")
168 168
 
169 169
 # Collect the output of the job so far
170 170
 docker logs $JOB
... ...
@@ -173,21 +172,27 @@ docker logs $JOB
173 173
 docker kill $JOB
174 174
 ```
175 175
 
176
-
177
-Listing all running containers
176
+Run an irc bouncer
177
+------------------
178 178
 
179 179
 ```bash
180
-docker ps
180
+BOUNCER_ID=$(docker run -d -p 6667 -u irc shykes/znc $USER $PASSWORD)
181
+echo "Configure your irc client to connect to port $(port $BOUNCER_ID 6667) of this machine"
181 182
 ```
182 183
 
184
+Run Redis
185
+---------
186
+
187
+```bash
188
+REDIS_ID=$(docker run -d -p 6379 shykes/redis redis-server)
189
+echo "Configure your redis client to connect to port $(port $REDIS_ID 6379) of this machine"
190
+```
183 191
 
184 192
 Share your own image!
185 193
 ---------------------
186 194
 
187 195
 ```bash
188
-docker pull base
189
-CONTAINER=$(docker run -d base apt-get install -y curl)
196
+CONTAINER=$(docker run -d ubuntu:12.10 apt-get install -y curl)
190 197
 docker commit -m "Installed curl" $CONTAINER $USER/betterbase
191 198
 docker push $USER/betterbase
192 199
 ```