Skip to content

Commit 67f330a

Browse files
Replace master branch with page content via GitHub
0 parents  commit 67f330a

File tree

7 files changed

+616
-0
lines changed

7 files changed

+616
-0
lines changed

images/checker.png

108 Bytes
Loading

images/dexec-short.gif

908 KB
Loading

index.html

+179
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="chrome=1">
6+
<title>Docker Exec</title>
7+
8+
<link rel="stylesheet" href="stylesheets/styles.css">
9+
<link rel="stylesheet" href="stylesheets/pygment_trac.css">
10+
<script src="javascripts/scale.fix.js"></script>
11+
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
12+
13+
<!--[if lt IE 9]>
14+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
15+
<![endif]-->
16+
</head>
17+
<body>
18+
<div class="wrapper">
19+
<header>
20+
<h1>Docker Exec</h1>
21+
<p>Execute code in many languages with Docker!</p>
22+
<p class="view"><a href="https://github.com/docker-exec/dexec">View the Project on GitHub</a></p>
23+
<ul>
24+
<li class="single"><a href="https://github.com/docker-exec/dexec">View On <strong>GitHub</strong></a></li>
25+
</ul>
26+
</header>
27+
<section>
28+
<h3>
29+
<a id="what" class="anchor" href="#what" aria-hidden="true"><span class="octicon octicon-link"></span></a>What?</h3>
30+
31+
<p>Docker Exec is a collection of Docker images capable of executing code in many different programming languages without requiring a single compiler or script interpreter on your machine.</p>
32+
33+
<p>The <code>dexec</code> command line interface provides a simple front end, picking the appropriate Docker image based on the source extension.</p>
34+
35+
<p><strong>See the <a href="https://github.com/docker-exec/dexec/blob/master/README.md#installation">dexec installation guide</a> to get started</strong></p>
36+
37+
<p><img src="https://docker-exec.github.io/images/dexec-short.gif" alt="dexec demo animation"></p>
38+
39+
<p>Let's take a closer look at one of the examples, <a href="https://github.com/docker-exec/cpp/blob/v1.0.0/test/helloworld.cpp">helloworld.cpp</a>:</p>
40+
41+
<div class="highlight highlight-c++"><pre>#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">&lt;</span>iostream<span class="pl-pds">&gt;</span></span>
42+
<span class="pl-k">int</span> <span class="pl-en">main</span>() {
43+
std::cout &lt;&lt; <span class="pl-s"><span class="pl-pds">"</span>Hello, World!<span class="pl-pds">"</span></span> &lt;&lt; std::endl;
44+
<span class="pl-k">return</span> <span class="pl-c1">0</span>;
45+
}</pre></div>
46+
47+
<p>executing it is simple:</p>
48+
49+
<pre><code>$ dexec foo.cpp
50+
51+
Hello, World!
52+
</code></pre>
53+
54+
<p>Docker Exec also supports passing arguments to the executing program, passing arguments to the compiler, mounting extra files and directories in the executing container as well as the ability to make source files executable as scripts using a shebang.</p>
55+
56+
<h3>
57+
<a id="why" class="anchor" href="#why" aria-hidden="true"><span class="octicon octicon-link"></span></a>Why?</h3>
58+
59+
<p>Docker Exec allows you to run code in a compiled language just as easily as you can for interpreted languages. This is useful for speeding up your ability to try things out in compiled languages.</p>
60+
61+
<p>The <a href="https://github.com/docker-exec/dexec/blob/master/README.md#reference">uniform interface</a> used to execute source for all of the different languages means that calls to <code>dexec</code> can be shelled out from other programs who need to execute arbitrary source, for example automated answer checkers for code tests in pre-interview situations or for university exercises.</p>
62+
63+
<p>Another benefit is that the only dependency on your machine becomes Docker instead of lots of different compilers and interpreters. Docker is a powerful tool and a lot is said about its potential for running web services and databases. However, it's also great for single program execution too and this is an example of how tools can be usefully virtualised just as well as web services.</p>
64+
65+
<p>Further to this, the virtualisation of the compilation and execution acts as a sandbox in the event you're not entirely sure how safe a piece of code is to run.</p>
66+
67+
<h3>
68+
<a id="how" class="anchor" href="#how" aria-hidden="true"><span class="octicon octicon-link"></span></a>How?</h3>
69+
70+
<p>A Docker image exists for each target language, with an associated automated build job on Docker Hub. The image contains the compiler, runtime or interpreter for that language and a <a href="https://github.com/docker-exec/image-common">bash script</a> that does any of the following depending on the language:</p>
71+
72+
<ul>
73+
<li>Compile the code and run the compiled executable.</li>
74+
<li>Compile the code and use a runtime to execute the compiled bytecode.</li>
75+
<li>Pass the code to a script interpreter.</li>
76+
</ul>
77+
78+
<p>The <code>dexec</code> utility wraps the following command:</p>
79+
80+
<div class="highlight highlight-sh"><pre>$ docker run -t --rm \
81+
-v <span class="pl-s"><span class="pl-pds">$(</span><span class="pl-c1">pwd</span> -P<span class="pl-pds">)</span></span>/foo.cpp:/tmp/dexec/build/foo.cpp \
82+
dexec/cpp foo.cpp</pre></div>
83+
84+
<p>Arguments can be passed to the executing code using:</p>
85+
86+
<pre><code>-a bar
87+
--arg bar
88+
--arg=bar
89+
</code></pre>
90+
91+
<p>Arguments can be passed to the compiler (if the language has one) using:</p>
92+
93+
<pre><code>-b foo
94+
--build-arg foo
95+
--build-arg=foo
96+
</code></pre>
97+
98+
<p>Extra file and folders can be mounted in the container with <code>dexec</code> using:</p>
99+
100+
<pre><code>-i foo.hpp
101+
--include foo.hpp
102+
--include=foo.hpp
103+
</code></pre>
104+
105+
<p>Prefixing a source file with a shebang that invokes dexec will make it executable:</p>
106+
107+
<pre><code>#!/usr/bin/env dexec
108+
</code></pre>
109+
110+
<h3>
111+
<a id="where" class="anchor" href="#where" aria-hidden="true"><span class="octicon octicon-link"></span></a>Where?</h3>
112+
113+
<ul>
114+
<li><a href="https://github.com/docker-exec/dexec">dexec on GitHub</a></li>
115+
<li><a href="https://bintray.com/dexec/release/dexec/view">dexec on Bintray</a></li>
116+
<li><a href="https://github.com/docker-exec">Docker Exec GitHub Repositories</a></li>
117+
<li><a href="https://hub.docker.com/repos/dexec/">Docker Exec Images on Docker Hub</a></li>
118+
</ul>
119+
120+
<h3>
121+
<a id="which" class="anchor" href="#which" aria-hidden="true"><span class="octicon octicon-link"></span></a>Which?</h3>
122+
123+
<p>The following languages are available:</p>
124+
125+
<ul>
126+
<li><a href="https://github.com/docker-exec/bash">Bash</a></li>
127+
<li><a href="https://github.com/docker-exec/c">C</a></li>
128+
<li><a href="https://github.com/docker-exec/clojure">Clojure</a></li>
129+
<li><a href="https://github.com/docker-exec/coffee">CoffeeScript</a></li>
130+
<li><a href="https://github.com/docker-exec/cpp">C++</a></li>
131+
<li><a href="https://github.com/docker-exec/csharp">C#</a></li>
132+
<li><a href="https://github.com/docker-exec/d">D</a></li>
133+
<li><a href="https://github.com/docker-exec/erlang">Erlang</a></li>
134+
<li><a href="https://github.com/docker-exec/fsharp">F#</a></li>
135+
<li><a href="https://github.com/docker-exec/go">Go</a></li>
136+
<li><a href="https://github.com/docker-exec/groovy">Groovy</a></li>
137+
<li><a href="https://github.com/docker-exec/haskell">Haskell</a></li>
138+
<li><a href="https://github.com/docker-exec/java">Java</a></li>
139+
<li><a href="https://github.com/docker-exec/lisp">Lisp</a></li>
140+
<li><a href="https://github.com/docker-exec/node">Node JS</a></li>
141+
<li><a href="https://github.com/docker-exec/objc">Objective C</a></li>
142+
<li><a href="https://github.com/docker-exec/ocaml">OCaml</a></li>
143+
<li><a href="https://github.com/docker-exec/perl">Perl</a></li>
144+
<li><a href="https://github.com/docker-exec/php">PHP</a></li>
145+
<li><a href="https://github.com/docker-exec/python">Python</a></li>
146+
<li><a href="https://github.com/docker-exec/racket">Racket</a></li>
147+
<li><a href="https://github.com/docker-exec/ruby">Ruby</a></li>
148+
<li><a href="https://github.com/docker-exec/rust">Rust</a></li>
149+
<li><a href="https://github.com/docker-exec/scala">Scala</a></li>
150+
</ul>
151+
152+
<h3>
153+
<a id="who" class="anchor" href="#who" aria-hidden="true"><span class="octicon octicon-link"></span></a>Who?</h3>
154+
155+
<p>I'm Andy Stanton (<a href="https://github.com/andystanton">@andystanton</a>).</p>
156+
157+
<h3>
158+
<a id="help" class="anchor" href="#help" aria-hidden="true"><span class="octicon octicon-link"></span></a>Help!</h3>
159+
160+
<p>Documentation can be found and issues raised in each image's repository.</p>
161+
</section>
162+
</div>
163+
<footer>
164+
<p>Hosted on GitHub Pages &mdash; Theme by <a href="https://github.com/orderedlist">orderedlist</a></p>
165+
</footer>
166+
<!--[if !IE]><script>fixScale(document);</script><![endif]-->
167+
<script type="text/javascript">
168+
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
169+
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
170+
</script>
171+
<script type="text/javascript">
172+
try {
173+
var pageTracker = _gat._getTracker("UA-48544248-4");
174+
pageTracker._trackPageview();
175+
} catch(err) {}
176+
</script>
177+
178+
</body>
179+
</html>

javascripts/scale.fix.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
fixScale = function(doc) {
2+
3+
var addEvent = 'addEventListener',
4+
type = 'gesturestart',
5+
qsa = 'querySelectorAll',
6+
scales = [1, 1],
7+
meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : [];
8+
9+
function fix() {
10+
meta.content = 'width=device-width,minimum-scale=' + scales[0] + ',maximum-scale=' + scales[1];
11+
doc.removeEventListener(type, fix, true);
12+
}
13+
14+
if ((meta = meta[meta.length - 1]) && addEvent in doc) {
15+
fix();
16+
scales = [.25, 1.6];
17+
doc[addEvent](type, fix, true);
18+
}
19+
20+
};

params.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"name":"Docker Exec","tagline":"Execute code in many languages with Docker!","body":"### What?\r\nDocker Exec is a collection of Docker images capable of executing code in many different programming languages without requiring a single compiler or script interpreter on your machine.\r\n\r\nThe ```dexec``` command line interface provides a simple front end, picking the appropriate Docker image based on the source extension.\r\n\r\n**See the [dexec installation guide](https://github.com/docker-exec/dexec/blob/master/README.md#installation) to get started**\r\n\r\n![dexec demo animation](https://docker-exec.github.io/images/dexec-short.gif)\r\n\r\nLet's take a closer look at one of the examples, [helloworld.cpp](https://github.com/docker-exec/cpp/blob/v1.0.0/test/helloworld.cpp):\r\n\r\n```c++\r\n#include <iostream>\r\nint main() {\r\n std::cout << \"Hello, World!\" << std::endl;\r\n return 0;\r\n}\r\n```\r\n\r\nexecuting it is simple:\r\n\r\n```\r\n$ dexec foo.cpp\r\n\r\nHello, World!\r\n```\r\n\r\nDocker Exec also supports passing arguments to the executing program, passing arguments to the compiler, mounting extra files and directories in the executing container as well as the ability to make source files executable as scripts using a shebang.\r\n\r\n### Why?\r\nDocker Exec allows you to run code in a compiled language just as easily as you can for interpreted languages. This is useful for speeding up your ability to try things out in compiled languages.\r\n\r\nThe [uniform interface](https://github.com/docker-exec/dexec/blob/master/README.md#reference) used to execute source for all of the different languages means that calls to ```dexec``` can be shelled out from other programs who need to execute arbitrary source, for example automated answer checkers for code tests in pre-interview situations or for university exercises.\r\n\r\nAnother benefit is that the only dependency on your machine becomes Docker instead of lots of different compilers and interpreters. Docker is a powerful tool and a lot is said about its potential for running web services and databases. However, it's also great for single program execution too and this is an example of how tools can be usefully virtualised just as well as web services.\r\n\r\nFurther to this, the virtualisation of the compilation and execution acts as a sandbox in the event you're not entirely sure how safe a piece of code is to run.\r\n\r\n### How?\r\nA Docker image exists for each target language, with an associated automated build job on Docker Hub. The image contains the compiler, runtime or interpreter for that language and a [bash script](https://github.com/docker-exec/image-common) that does any of the following depending on the language:\r\n\r\n* Compile the code and run the compiled executable.\r\n* Compile the code and use a runtime to execute the compiled bytecode.\r\n* Pass the code to a script interpreter.\r\n\r\nThe ```dexec``` utility wraps the following command:\r\n\r\n```sh\r\n$ docker run -t --rm \\\r\n -v $(pwd -P)/foo.cpp:/tmp/dexec/build/foo.cpp \\\r\n dexec/cpp foo.cpp\r\n```\r\n\r\nArguments can be passed to the executing code using:\r\n\r\n```\r\n-a bar\r\n--arg bar\r\n--arg=bar\r\n```\r\n\r\nArguments can be passed to the compiler (if the language has one) using:\r\n\r\n```\r\n-b foo\r\n--build-arg foo\r\n--build-arg=foo\r\n```\r\n\r\nExtra file and folders can be mounted in the container with ```dexec``` using:\r\n\r\n```\r\n-i foo.hpp\r\n--include foo.hpp\r\n--include=foo.hpp\r\n```\r\n\r\nPrefixing a source file with a shebang that invokes dexec will make it executable:\r\n\r\n```\r\n#!/usr/bin/env dexec\r\n```\r\n\r\n### Where?\r\n* [dexec on GitHub](https://github.com/docker-exec/dexec)\r\n* [dexec on Bintray](https://bintray.com/dexec/release/dexec/view)\r\n* [Docker Exec GitHub Repositories](https://github.com/docker-exec)\r\n* [Docker Exec Images on Docker Hub](https://hub.docker.com/repos/dexec/)\r\n\r\n### Which?\r\nThe following languages are available:\r\n* [Bash](https://github.com/docker-exec/bash)\r\n* [C](https://github.com/docker-exec/c)\r\n* [Clojure](https://github.com/docker-exec/clojure)\r\n* [CoffeeScript](https://github.com/docker-exec/coffee)\r\n* [C++](https://github.com/docker-exec/cpp)\r\n* [C#](https://github.com/docker-exec/csharp)\r\n* [D](https://github.com/docker-exec/d)\r\n* [Erlang](https://github.com/docker-exec/erlang)\r\n* [F#](https://github.com/docker-exec/fsharp)\r\n* [Go](https://github.com/docker-exec/go)\r\n* [Groovy](https://github.com/docker-exec/groovy)\r\n* [Haskell](https://github.com/docker-exec/haskell)\r\n* [Java](https://github.com/docker-exec/java)\r\n* [Lisp](https://github.com/docker-exec/lisp)\r\n* [Node JS](https://github.com/docker-exec/node)\r\n* [Objective C](https://github.com/docker-exec/objc)\r\n* [OCaml](https://github.com/docker-exec/ocaml)\r\n* [Perl](https://github.com/docker-exec/perl)\r\n* [PHP](https://github.com/docker-exec/php)\r\n* [Python](https://github.com/docker-exec/python)\r\n* [Racket](https://github.com/docker-exec/racket)\r\n* [Ruby](https://github.com/docker-exec/ruby)\r\n* [Rust](https://github.com/docker-exec/rust)\r\n* [Scala](https://github.com/docker-exec/scala)\r\n\r\n### Who?\r\nI'm Andy Stanton ([@andystanton](https://github.com/andystanton)).\r\n\r\n### Help!\r\nDocumentation can be found and issues raised in each image's repository.","google":"UA-48544248-4","note":"Don't delete this file! It's used internally to help with page regeneration."}

stylesheets/pygment_trac.css

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
.highlight .hll { background-color: #49483e }
2+
.highlight { background: #3A3C42; color: #f8f8f2 }
3+
.highlight .c { color: #75715e } /* Comment */
4+
.highlight .err { color: #960050; background-color: #1e0010 } /* Error */
5+
.highlight .k { color: #66d9ef } /* Keyword */
6+
.highlight .l { color: #ae81ff } /* Literal */
7+
.highlight .n { color: #f8f8f2 } /* Name */
8+
.highlight .o { color: #f92672 } /* Operator */
9+
.highlight .p { color: #f8f8f2 } /* Punctuation */
10+
.highlight .cm { color: #75715e } /* Comment.Multiline */
11+
.highlight .cp { color: #75715e } /* Comment.Preproc */
12+
.highlight .c1 { color: #75715e } /* Comment.Single */
13+
.highlight .cs { color: #75715e } /* Comment.Special */
14+
.highlight .ge { font-style: italic } /* Generic.Emph */
15+
.highlight .gs { font-weight: bold } /* Generic.Strong */
16+
.highlight .kc { color: #66d9ef } /* Keyword.Constant */
17+
.highlight .kd { color: #66d9ef } /* Keyword.Declaration */
18+
.highlight .kn { color: #f92672 } /* Keyword.Namespace */
19+
.highlight .kp { color: #66d9ef } /* Keyword.Pseudo */
20+
.highlight .kr { color: #66d9ef } /* Keyword.Reserved */
21+
.highlight .kt { color: #66d9ef } /* Keyword.Type */
22+
.highlight .ld { color: #e6db74 } /* Literal.Date */
23+
.highlight .m { color: #ae81ff } /* Literal.Number */
24+
.highlight .s { color: #e6db74 } /* Literal.String */
25+
.highlight .na { color: #a6e22e } /* Name.Attribute */
26+
.highlight .nb { color: #f8f8f2 } /* Name.Builtin */
27+
.highlight .nc { color: #a6e22e } /* Name.Class */
28+
.highlight .no { color: #66d9ef } /* Name.Constant */
29+
.highlight .nd { color: #a6e22e } /* Name.Decorator */
30+
.highlight .ni { color: #f8f8f2 } /* Name.Entity */
31+
.highlight .ne { color: #a6e22e } /* Name.Exception */
32+
.highlight .nf { color: #a6e22e } /* Name.Function */
33+
.highlight .nl { color: #f8f8f2 } /* Name.Label */
34+
.highlight .nn { color: #f8f8f2 } /* Name.Namespace */
35+
.highlight .nx { color: #a6e22e } /* Name.Other */
36+
.highlight .py { color: #f8f8f2 } /* Name.Property */
37+
.highlight .nt { color: #f92672 } /* Name.Tag */
38+
.highlight .nv { color: #f8f8f2 } /* Name.Variable */
39+
.highlight .ow { color: #f92672 } /* Operator.Word */
40+
.highlight .w { color: #f8f8f2 } /* Text.Whitespace */
41+
.highlight .mf { color: #ae81ff } /* Literal.Number.Float */
42+
.highlight .mh { color: #ae81ff } /* Literal.Number.Hex */
43+
.highlight .mi { color: #ae81ff } /* Literal.Number.Integer */
44+
.highlight .mo { color: #ae81ff } /* Literal.Number.Oct */
45+
.highlight .sb { color: #e6db74 } /* Literal.String.Backtick */
46+
.highlight .sc { color: #e6db74 } /* Literal.String.Char */
47+
.highlight .sd { color: #e6db74 } /* Literal.String.Doc */
48+
.highlight .s2 { color: #e6db74 } /* Literal.String.Double */
49+
.highlight .se { color: #ae81ff } /* Literal.String.Escape */
50+
.highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */
51+
.highlight .si { color: #e6db74 } /* Literal.String.Interpol */
52+
.highlight .sx { color: #e6db74 } /* Literal.String.Other */
53+
.highlight .sr { color: #e6db74 } /* Literal.String.Regex */
54+
.highlight .s1 { color: #e6db74 } /* Literal.String.Single */
55+
.highlight .ss { color: #e6db74 } /* Literal.String.Symbol */
56+
.highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
57+
.highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */
58+
.highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */
59+
.highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */
60+
.highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */

0 commit comments

Comments
 (0)