fix CR feedback, add better sample
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
diff --git a/components.js b/components.js
index 8997f0a..346cb8e 100644
--- a/components.js
+++ b/components.js
@@ -114,8 +114,8 @@ var components = {
"require": "clike",
"owner": "Golmote"
},
- "dockerfile": {
- "title": "Dockerfile",
+ "docker": {
+ "title": "Docker",
"owner": "JustinBeckwith"
},
"eiffel": {
diff --git a/components/prism-docker.js b/components/prism-docker.js
index 835f037..b8724b5 100644
--- a/components/prism-docker.js
+++ b/components/prism-docker.js
@@ -1,8 +1,9 @@
Prism.languages.docker = {
'keyword': {
- pattern: /^\s*\b(ONBUILD|FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|COPY|VOLUME|USER|WORKDIR|CMD|ENTRYPOINT)\b\s/mi
+ pattern: /(^\s*)(?:ONBUILD|FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|COPY|VOLUME|USER|WORKDIR|CMD|ENTRYPOINT)(?=\s)/mi,
+ lookbehind: true
},
- 'string': /("|')(\\\n|\\?.)*?\1/,
- 'comment': /#[^\n]+/,
- 'punctuation': /([:[\]{}\-,|>?]|---|\.\.\.)/
+ 'string': /("|')(\\\n|\\?.)*?\1/,
+ 'comment': /#.*/,
+ 'punctuation': /([:[\]{}\-,|>?]|---|\.\.\.)/
};
diff --git a/examples/prism-docker.html b/examples/prism-docker.html
new file mode 100644
index 0000000..a37b2df
--- /dev/null
+++ b/examples/prism-docker.html
@@ -0,0 +1,52 @@
+<h1>Docker</h1>
+<p>To use this language, use the class "language-docker".</p>
+
+<h2>Comments</h2>
+<pre><code># These are the comments for a dockerfile.
+# I want to make sure $(variables) don't break out,
+# and we shouldn't see keywords like ADD or ENTRYPOINT
+</code></pre>
+
+<h2>Full example</h2>
+<pre><code># Nginx
+#
+# VERSION 0.0.1
+
+FROM ubuntu
+MAINTAINER Victor Vieux <victor@docker.com>
+
+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
+
+# Firefox over VNC
+#
+# VERSION 0.3
+
+FROM ubuntu
+
+# Install vnc, xvfb in order to create a 'fake' display and firefox
+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
+CMD ["x11vnc", "-forever", "-usepw", "-create"]
+
+# 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.
+</code></pre>
diff --git a/examples/prism-dockerfile.html b/examples/prism-dockerfile.html
deleted file mode 100644
index 295a3cf..0000000
--- a/examples/prism-dockerfile.html
+++ /dev/null
@@ -1,39 +0,0 @@
-<h1>Dockerfile</h1>
-<p>To use this language, use the class "language-docker".</p>
-
-<h2>Comments</h2>
-<pre><code># These are the comments for a dockerfile.
-# I want to make sure $(variables) don't break out,
-# and we shouldn't see keywords like ADD or ENTRYPOINT
-</code></pre>
-
-<h2>Instructions</h2>
-<pre><code># Use the official go docker image built on debian.
-FROM golang:1.4.2
-
-# Grab the source code and add it to the workspace.
-ADD . /go/src/github.com/JustinBeckwith/revel-appengine
-
-# Install revel and the revel CLI.
-RUN go get github.com/revel/revel
-RUN go get github.com/revel/cmd/revel
-</code></pre>
-
-
-<h2>Full example</h2>
-<pre><code># Use the official go docker image built on debian.
-FROM golang:1.4.2
-
-# Grab the source code and add it to the workspace.
-ADD . /go/src/github.com/JustinBeckwith/revel-appengine
-
-# Install revel and the revel CLI.
-RUN go get github.com/revel/revel
-RUN go get github.com/revel/cmd/revel
-
-# Use the revel CLI to start up our application.
-ENTRYPOINT revel run github.com/JustinBeckwith/revel-appengine dev 8080
-
-# Open up the port where the app is running.
-EXPOSE 8080
-</code></pre>