Docker - Build Arg in Source File
<p>I'm trying to build a Docker container whose source tag I want to pass as a parameter.</p>

<p>Build script:</p>

<pre><code>docker build \
    --pull=true \
    ...
    --build-arg version=${version}
</code></pre>

<p>The Dockerfile:</p>

<pre><code>ARG version

FROM registry/repo:${version}
</code></pre>

<p>Running this gives me the error <code>Please provide a source image with</code>from<code>prior to commit</code>. </p>

<p>Is there any way I can pass the version to pull as a build argument and use it? I'm on docker version <code>1.12</code></p>