mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Make examples bash-highlighted
Remove DOCKER-VERSION, easier to maintain Add example of multiple FROM steps
This commit is contained in:
parent
a98eafaf58
commit
9416574569
1 changed files with 20 additions and 5 deletions
|
@ -126,12 +126,11 @@ curl was installed within the image.
|
||||||
3. Dockerfile Examples
|
3. Dockerfile Examples
|
||||||
======================
|
======================
|
||||||
|
|
||||||
::
|
.. code-block:: bash
|
||||||
|
|
||||||
# Nginx
|
# Nginx
|
||||||
#
|
#
|
||||||
# VERSION 0.0.1
|
# VERSION 0.0.1
|
||||||
# DOCKER-VERSION 0.2
|
|
||||||
|
|
||||||
FROM ubuntu
|
FROM ubuntu
|
||||||
MAINTAINER Guillaume J. Charmes "guillaume@dotcloud.com"
|
MAINTAINER Guillaume J. Charmes "guillaume@dotcloud.com"
|
||||||
|
@ -143,12 +142,11 @@ curl was installed within the image.
|
||||||
RUN apt-get install -y inotify-tools nginx apache2 openssh-server
|
RUN apt-get install -y inotify-tools nginx apache2 openssh-server
|
||||||
INSERT https://raw.github.com/creack/docker-vps/master/nginx-wrapper.sh /usr/sbin/nginx-wrapper
|
INSERT https://raw.github.com/creack/docker-vps/master/nginx-wrapper.sh /usr/sbin/nginx-wrapper
|
||||||
|
|
||||||
::
|
.. code-block:: bash
|
||||||
|
|
||||||
# Firefox over VNC
|
# Firefox over VNC
|
||||||
#
|
#
|
||||||
# VERSION 0.3
|
# VERSION 0.3
|
||||||
# DOCKER-VERSION 0.2
|
|
||||||
|
|
||||||
FROM ubuntu
|
FROM ubuntu
|
||||||
# make sure the package repository is up to date
|
# make sure the package repository is up to date
|
||||||
|
@ -160,8 +158,25 @@ curl was installed within the image.
|
||||||
RUN mkdir /.vnc
|
RUN mkdir /.vnc
|
||||||
# Setup a password
|
# Setup a password
|
||||||
RUN x11vnc -storepasswd 1234 ~/.vnc/passwd
|
RUN x11vnc -storepasswd 1234 ~/.vnc/passwd
|
||||||
# Autostart firefox (might not be the best way to do it, but it does the trick)
|
# Autostart firefox (might not be the best way, but it does the trick)
|
||||||
RUN bash -c 'echo "firefox" >> /.bashrc'
|
RUN bash -c 'echo "firefox" >> /.bashrc'
|
||||||
|
|
||||||
EXPOSE 5900
|
EXPOSE 5900
|
||||||
CMD ["x11vnc", "-forever", "-usepw", "-create"]
|
CMD ["x11vnc", "-forever", "-usepw", "-create"]
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
# Multiple images example
|
||||||
|
#
|
||||||
|
# VERSION 0.1
|
||||||
|
|
||||||
|
FROM ubuntu
|
||||||
|
RUN echo foo > bar
|
||||||
|
# Will output something like ===> 907ad6c2736f
|
||||||
|
|
||||||
|
FROM ubuntu
|
||||||
|
RUN echo moo > oink
|
||||||
|
# Will output something like ===> 695d7793cbe4
|
||||||
|
|
||||||
|
# You'll now have two images, 907ad6c2736f with /bar, and 695d7793cbe4 with
|
||||||
|
# /oink.
|
Loading…
Add table
Reference in a new issue