Merge pull request #16806 from aidanhs/aphs-split-docs-dockerfiles

Don't put dockerfiles in one continuous code block
This commit is contained in:
moxiegirl 2015-10-07 13:40:19 -07:00
commit 4c1540c8d2
1 changed files with 39 additions and 31 deletions

View File

@ -1166,45 +1166,53 @@ or a signal name in the format SIGNAME, for instance SIGKILL.
## Dockerfile examples ## Dockerfile examples
# Nginx Below you can see some examples of Dockerfile syntax. If you're interested in
# something more realistic, take a look at the list of [Dockerization examples](/examples/).
# VERSION 0.0.1
FROM ubuntu ```
MAINTAINER Victor Vieux <victor@docker.com> # Nginx
#
# VERSION 0.0.1
LABEL Description="This image is used to start the foobar executable" Vendor="ACME Products" Version="1.0" FROM ubuntu
RUN apt-get update && apt-get install -y inotify-tools nginx apache2 openssh-server MAINTAINER Victor Vieux <victor@docker.com>
# Firefox over VNC LABEL Description="This image is used to start the foobar executable" Vendor="ACME Products" Version="1.0"
# RUN apt-get update && apt-get install -y inotify-tools nginx apache2 openssh-server
# VERSION 0.3 ```
FROM ubuntu ```
# Firefox over VNC
#
# VERSION 0.3
# Install vnc, xvfb in order to create a 'fake' display and firefox FROM ubuntu
RUN apt-get update && apt-get install -y x11vnc xvfb firefox
RUN mkdir ~/.vnc
# Setup a password
RUN x11vnc -storepasswd 1234 ~/.vnc/passwd
# Autostart firefox (might not be the best way, but it does the trick)
RUN bash -c 'echo "firefox" >> /.bashrc'
EXPOSE 5900 # Install vnc, xvfb in order to create a 'fake' display and firefox
CMD ["x11vnc", "-forever", "-usepw", "-create"] RUN apt-get update && apt-get install -y x11vnc xvfb firefox
RUN mkdir ~/.vnc
# Setup a password
RUN x11vnc -storepasswd 1234 ~/.vnc/passwd
# Autostart firefox (might not be the best way, but it does the trick)
RUN bash -c 'echo "firefox" >> /.bashrc'
# Multiple images example EXPOSE 5900
# CMD ["x11vnc", "-forever", "-usepw", "-create"]
# VERSION 0.1 ```
FROM ubuntu ```
RUN echo foo > bar # Multiple images example
# Will output something like ===> 907ad6c2736f #
# VERSION 0.1
FROM ubuntu FROM ubuntu
RUN echo moo > oink RUN echo foo > bar
# Will output something like ===> 695d7793cbe4 # Will output something like ===> 907ad6c2736f
# You᾿ll now have two images, 907ad6c2736f with /bar, and 695d7793cbe4 with FROM ubuntu
# /oink. RUN echo moo > oink
# Will output something like ===> 695d7793cbe4
# You᾿ll now have two images, 907ad6c2736f with /bar, and 695d7793cbe4 with
# /oink.
```