1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Add examples to the README

This commit is contained in:
Solomon Hykes 2013-04-18 22:24:29 -07:00
parent 3ae5c45d9a
commit 79a78d37e7

View file

@ -144,12 +144,11 @@ Throwaway shell in a base ubuntu image
-------------------------------------- --------------------------------------
```bash ```bash
# Download a base image docker pull ubuntu:12.10
docker pull base
# Run an interactive shell in the base image, # Run an interactive shell
# allocate a tty, attach stdin and stdout # allocate a tty, attach stdin and stdout
docker run -i -t base /bin/bash docker run -i -t ubuntu:12.10 /bin/bash
``` ```
Detaching from the interactive shell Detaching from the interactive shell
@ -164,7 +163,7 @@ Starting a long-running worker process
```bash ```bash
# Start a very useful long-running process # Start a very useful long-running process
JOB=$(docker run -d base /bin/sh -c "while true; do echo Hello world; sleep 1; done") JOB=$(docker run -d ubuntu /bin/sh -c "while true; do echo Hello world; sleep 1; done")
# Collect the output of the job so far # Collect the output of the job so far
docker logs $JOB docker logs $JOB
@ -173,21 +172,27 @@ docker logs $JOB
docker kill $JOB docker kill $JOB
``` ```
Run an irc bouncer
Listing all running containers ------------------
------------------------------
```bash ```bash
docker ps BOUNCER_ID=$(docker run -d -p 6667 -u irc shykes/znc $USER $PASSWORD)
echo "Configure your irc client to connect to port $(port $BOUNCER_ID 6667) of this machine"
``` ```
Run Redis
---------
```bash
REDIS_ID=$(docker run -d -p 6379 shykes/redis redis-server)
echo "Configure your redis client to connect to port $(port $REDIS_ID 6379) of this machine"
```
Share your own image! Share your own image!
--------------------- ---------------------
```bash ```bash
docker pull base CONTAINER=$(docker run -d ubuntu:12.10 apt-get install -y curl)
CONTAINER=$(docker run -d base apt-get install -y curl)
docker commit -m "Installed curl" $CONTAINER $USER/betterbase docker commit -m "Installed curl" $CONTAINER $USER/betterbase
docker push $USER/betterbase docker push $USER/betterbase
``` ```