{"id":18758,"date":"2017-09-28T12:15:52","date_gmt":"2017-09-28T09:15:52","guid":{"rendered":"https:\/\/www.webcodegeeks.com\/?p=18758"},"modified":"2017-09-22T10:56:26","modified_gmt":"2017-09-22T07:56:26","slug":"3-different-ways-provide-docker-build-context","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/","title":{"rendered":"3 Different Ways to Provide Docker Build Context"},"content":{"rendered":"<p>One of the powerful things about Docker is that it is possible for someone to use Docker every day without ever having to create their own custom container. In today\u2019s article, we are going to explore a few uncommon ways to build a Docker container.<\/p>\n<p>The <code>docker build<\/code> command has many options that can be considered uncommon or only used for special situations. In this article, we are specifically going to focus on different ways to provide the <code>docker build<\/code> command a source or context to build from.<\/p>\n<p>To explain this better, let\u2019s first explore the traditional build approach.<\/p>\n<h2>Traditional Approach<\/h2>\n<p>The traditional build approach essentially consists of executing the <code>docker build<\/code> command within a directory that contains a <code>Dockerfile<\/code>. Let\u2019s see this approach in action with the below example.<\/p>\n<pre class=\"brush:bash\">$ docker build -t automatron .\r\nSending build context to Docker daemon  4.368MB\r\nStep 1\/9 : FROM ubuntu:14.04\r\n ---&gt; 3f755ca42730\r\nStep 2\/9 : RUN apt-get update --fix-missing &amp;&amp;     apt-get -y upgrade &amp;&amp;     apt-get -y install     python-pip     python-dev     nmap     curl     libffi-dev     build-essential     libssl-dev\r\n ---&gt; Using cache\r\n ---&gt; 901e767bce5a\r\nStep 3\/9 : ADD requirements.txt \/\r\n ---&gt; Using cache\r\n ---&gt; d8e0c2f89a72\r\nStep 4\/9 : RUN pip install --upgrade setuptools\r\n ---&gt; Using cache\r\n ---&gt; d62382ab676f\r\nStep 5\/9 : RUN pip install -r \/requirements.txt\r\n ---&gt; Using cache\r\n ---&gt; cca17f716d3d\r\nStep 6\/9 : RUN pip install honcho\r\n ---&gt; Using cache\r\n ---&gt; 62293cc90b19\r\nStep 7\/9 : ADD . \/\r\n ---&gt; Using cache\r\n ---&gt; 808d0bdf961d\r\nStep 8\/9 : RUN find -name \"*.sh\" -exec chmod 755 {} \\;\r\n ---&gt; Using cache\r\n ---&gt; 353248eb9652\r\nStep 9\/9 : CMD honcho start\r\n ---&gt; Using cache\r\n ---&gt; 0c650b43b3d4\r\nSuccessfully built 0c650b43b3d4\r\nSuccessfully tagged automatron:latest<\/pre>\n<p>During the <code>docker build<\/code> execution shown above, we specify two options. The first being the <code>-t<\/code> flag; as we explored in an <a href=\"https:\/\/blog.codeship.com\/using-docker-push-to-publish-images-to-dockerhub\/\">earlier article<\/a>, the <code>-t<\/code> flag is used to \u201ctag\u201d or name the resulting image. In the example above, we simply named the container <code>automatron<\/code>.<\/p>\n<p>The second option is <code>.<\/code>; this option is the context or source that the <code>docker build<\/code> command should use during the build. By specifying <code>.<\/code>, we are specifying that Docker should execute the build using the current working directory as the context. What this means is that <code>docker build<\/code> will look for a <code>Dockerfile<\/code> (the instruction file for building containers) within the specified directory.<\/p>\n<p>If we were to execute this command from one directory higher, our command would look like the following example:<\/p>\n<pre class=\"brush:bash\">$ docker build -t automatron automatron\/\r\nSending build context to Docker daemon  4.368MB\r\nStep 1\/9 : FROM ubuntu:14.04\r\n ---&gt; 3f755ca42730\r\nStep 2\/9 : RUN apt-get update --fix-missing &amp;&amp;     apt-get -y upgrade &amp;&amp;     apt-get -y install     python-pip     python-dev     nmap     curl     libffi-dev     build-essential     libssl-dev &amp;&amp;     rm -rf \/var\/lib\/apt\/lists\/*\r\n ---&gt; Using cache\r\n ---&gt; 901e767bce5a\r\nStep 3\/9 : ADD requirements.txt \/\r\n ---&gt; Using cache\r\n ---&gt; d8e0c2f89a72\r\nStep 4\/9 : RUN pip install --upgrade setuptools\r\n ---&gt; Using cache\r\n ---&gt; d62382ab676f\r\nStep 5\/9 : RUN pip install -r \/requirements.txt\r\n ---&gt; Using cache\r\n ---&gt; cca17f716d3d\r\nStep 6\/9 : RUN pip install honcho\r\n ---&gt; Using cache\r\n ---&gt; 62293cc90b19\r\nStep 7\/9 : ADD . \/\r\n ---&gt; Using cache\r\n ---&gt; 808d0bdf961d\r\nStep 8\/9 : RUN find -name \"*.sh\" -exec chmod 755 {} \\;\r\n ---&gt; Using cache\r\n ---&gt; 353248eb9652\r\nStep 9\/9 : CMD honcho start\r\n ---&gt; Using cache\r\n ---&gt; 0c650b43b3d4\r\nSuccessfully built 0c650b43b3d4\r\nSuccessfully tagged automatron:latest<\/pre>\n<p>The commands above should be familiar to anyone who regularly builds custom Docker containers. However, the approach above is not the only way we can pass context to the <code>docker build<\/code> command.<\/p>\n<h2>Building From a Git Repository<\/h2>\n<p>In the above example, we built a container for the open-source project <a href=\"https:\/\/github.com\/madflojo\/automatron\">Automatron<\/a>. Since this is a project hosted on GitHub and this project contains a <code>Dockerfile<\/code> in its top level directory, we can streamline this <code>docker build<\/code> process by building directly from the Git repository.<\/p>\n<pre class=\"brush:bash\">$ docker build -t automatron https:\/\/github.com\/madflojo\/automatron.git\r\nSending build context to Docker daemon  1.938MB\r\nStep 1\/9 : FROM ubuntu:14.04\r\n ---&gt; 3f755ca42730\r\nStep 2\/9 : RUN apt-get update --fix-missing &amp;&amp;     apt-get -y upgrade &amp;&amp;     apt-get -y install     python-pip     python-dev     nmap     curl     libffi-dev     build-essential     libssl-dev\r\n ---&gt; Using cache\r\n ---&gt; 956f75f19219\r\nStep 3\/9 : ADD requirements.txt \/\r\n ---&gt; Using cache\r\n ---&gt; 23a02980ee87\r\nStep 4\/9 : RUN pip install --upgrade setuptools\r\n ---&gt; Using cache\r\n ---&gt; 36069877f17b\r\nStep 5\/9 : RUN pip install -r \/requirements.txt\r\n ---&gt; Using cache\r\n ---&gt; 083745ce4316\r\nStep 6\/9 : RUN pip install honcho\r\n ---&gt; Using cache\r\n ---&gt; 2bd024e0890d\r\nStep 7\/9 : ADD . \/\r\n ---&gt; 58b5b6d021c7\r\nRemoving intermediate container d3b2db67817f\r\nStep 8\/9 : RUN find -name \"*.sh\" -exec chmod 755 {} \\;\r\n ---&gt; Running in 5e0d91149c94\r\n ---&gt; 53f04392979a\r\nRemoving intermediate container 5e0d91149c94\r\nStep 9\/9 : CMD honcho start\r\n ---&gt; Running in 9cd301a364cf\r\n ---&gt; fb62cbb68063\r\nRemoving intermediate container 9cd301a364cf\r\nSuccessfully built fb62cbb68063\r\nSuccessfully tagged automatron:latest<\/pre>\n<p>In the first example, the traditional build method. We had a copy of the Automatron project cloned to our local system. When we executed the build, we did so using a local directory. In the example above, building from a Git repository. We simply use the Git repository URL as the context for the <code>docker build<\/code> command.<\/p>\n<p>When executed in this manner, Docker will clone the remote Git repository and perform the build using the cloned repository as its context.<\/p>\n<p>!Sign up for a free Codeship Account<\/p>\n<h2>Understanding Build Context<\/h2>\n<p>When talking about Docker builds, <em>context<\/em> means the source directory used when building the container. To explain this a bit better, let\u2019s look at the <code>docker build<\/code> output.<\/p>\n<pre class=\"brush:bash\">Step 3\/9 : ADD requirements.txt \/\r\n ---&gt; Using cache\r\n ---&gt; 23a02980ee87\r\nStep 4\/9 : RUN pip install --upgrade setuptools\r\n ---&gt; Using cache\r\n ---&gt; 36069877f17b\r\nStep 5\/9 : RUN pip install -r \/requirements.txt\r\n ---&gt; Using cache\r\n ---&gt; 083745ce4316<\/pre>\n<p>In both the traditional and Git examples, these lines were part of the build output. These are Docker build steps that are specified within the Automatron <code>Dockerfile<\/code>.<\/p>\n<p>The first step (step 3 of 9) is <code>ADD requirements.txt \/<\/code>. This step will add the <code>requirements.txt<\/code> file into the Docker container image being built.<\/p>\n<p>In the first example, the traditional local directory approach. The <code>requirements.txt<\/code> was copied from the local directory (the context directory) into the Docker container. This is the type of functionality we are used to with a basic build.<\/p>\n<p>Where the second example \u2014 the Git example \u2014 differs is that the Git repository is used as the context directory. What this means is that when the <code>ADD<\/code> instruction executed, it added the <code>requirements.txt<\/code> file from the Git repository itself, not the local directory.<\/p>\n<p>To explain this a little better, even if I have a <code>requirements.txt<\/code> file in the current working directory, the <code>requirements.txt<\/code> that is added will not be from my local directory, but rather the <code>requirements.txt<\/code> hosted on the Git repository.<\/p>\n<p>This is an important concept to understand not only for this article, but when building Docker containers in general. As many times when troubleshooting why the <code>ADD<\/code> or <code>COPY<\/code> instructions fail, it is often they are trying to reference something outside of the build context.<\/p>\n<h2>Building From a Tar File<\/h2>\n<p>In addition to building containers using a remote Git repository, the <code>docker build<\/code> command is also able to take remote TAR files as build context.<\/p>\n<p>Let\u2019s take a look at this in action to get a better understanding.<\/p>\n<pre class=\"brush:bash\">$ docker build -t automatron http:\/\/example.com\/automatron.tar.gz\r\nStep 1\/9 : FROM ubuntu:14.04om remote url: http:\/\/example.com\/automatron.tar.gz [==================================================&gt;]  2.418MB\/2.418MB\r\n---&gt; 3f755ca42730\r\nStep 2\/9 : RUN apt-get update --fix-missing &amp;&amp;     apt-get -y upgrade &amp;&amp;     apt-get -y install     python-pip     python-dev     nmap     curl     libffi-dev     build-essential     libssl-dev &amp;&amp;     rm -rf \/var\/lib\/apt\/lists\/*\r\n---&gt; Using cache\r\n---&gt; 901e767bce5a\r\nStep 3\/9 : ADD requirements.txt \/\r\n---&gt; Using cache\r\n---&gt; 67206f314a21\r\nStep 4\/9 : RUN pip install --upgrade setuptools\r\n---&gt; Using cache\r\n---&gt; ea61de8843be\r\nStep 5\/9 : RUN pip install -r \/requirements.txt\r\n---&gt; Using cache\r\n---&gt; bdefd81afb47\r\nStep 6\/9 : RUN pip install honcho\r\n---&gt; Using cache\r\n---&gt; 16c4ca480eca\r\nStep 7\/9 : ADD . \/\r\n---&gt; Using cache\r\n---&gt; 8cce790d2b46\r\nStep 8\/9 : RUN find -name \"*.sh\" -exec chmod 755 {} \\;\r\n---&gt; Using cache\r\n---&gt; 3a9f60aadff7\r\nStep 9\/9 : CMD honcho start\r\n---&gt; Using cache\r\n---&gt; 7e95852e0e16\r\nSuccessfully built 7e95852e0e16\r\nSuccessfully tagged automatron:latest<\/pre>\n<p>The above <code>docker build<\/code> execution is similar to the Git example except for one difference. Rather than the target context being a Git repository, it is a remote TAR file. I am specifying that the TAR file is remote because the <code>docker build<\/code> command (at the time of this article) does not support using a local TAR file as the build context.<\/p>\n<p>What it does support is downloading a TAR file via HTTP, extracting that TAR, and using its contents for the build context directory. In the example above, the TAR file was compressed using <code>gzip<\/code>; the <code>docker build<\/code> command currently supports both the <code>bzip<\/code> and <code>gzip<\/code> compression formats.<\/p>\n<h2>Summary<\/h2>\n<p>In this article, we explored three different ways to provide build context to the <code>docker build<\/code> command. These methods can be useful when the container to be built is provided via a TAR or Git repository, as executing the builds by specifying the remote location can save several execution steps.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td>Published on Web Code Geeks with permission by Ben Cane, partner at our <a href=\"http:\/\/www.webcodegeeks.com\/join-us\/wcg\/\" target=\"_blank\" rel=\"noopener\">WCG program<\/a>. See the original article here: <a href=\"https:\/\/blog.codeship.com\/3-different-ways-to-provide-docker-build-context\/\" target=\"_blank\" rel=\"noopener\">3 Different Ways to Provide Docker Build Context<\/a><\/p>\n<p>Opinions expressed by Web Code Geeks contributors are their own.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>One of the powerful things about Docker is that it is possible for someone to use Docker every day without ever having to create their own custom container. In today\u2019s article, we are going to explore a few uncommon ways to build a Docker container. The docker build command has many options that can be &hellip;<\/p>\n","protected":false},"author":158,"featured_media":10356,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[217],"class_list":["post-18758","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","tag-docker"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>3 Different Ways to Provide Docker Build Context - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"One of the powerful things about Docker is that it is possible for someone to use Docker every day without ever having to create their own custom\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"3 Different Ways to Provide Docker Build Context - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"One of the powerful things about Docker is that it is possible for someone to use Docker every day without ever having to create their own custom\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2017-09-28T09:15:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Benjamin Cane\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Benjamin Cane\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/\"},\"author\":{\"name\":\"Benjamin Cane\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/4f5d918df9c19fab91b5b205357ce0b8\"},\"headline\":\"3 Different Ways to Provide Docker Build Context\",\"datePublished\":\"2017-09-28T09:15:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/\"},\"wordCount\":873,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\",\"keywords\":[\"Docker\"],\"articleSection\":[\"DevOps\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/\",\"name\":\"3 Different Ways to Provide Docker Build Context - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\",\"datePublished\":\"2017-09-28T09:15:52+00:00\",\"description\":\"One of the powerful things about Docker is that it is possible for someone to use Docker every day without ever having to create their own custom\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DevOps\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/devops\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"3 Different Ways to Provide Docker Build Context\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/4f5d918df9c19fab91b5b205357ce0b8\",\"name\":\"Benjamin Cane\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/09c6af2f1a7430456089189937094b817ef1b7c75ab9968bfd3ec35d938d914b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/09c6af2f1a7430456089189937094b817ef1b7c75ab9968bfd3ec35d938d914b?s=96&d=mm&r=g\",\"caption\":\"Benjamin Cane\"},\"description\":\"Benjamin Cane is a systems architect in the financial services industry. He writes about Linux systems administration on his blog and has recently published his first book, Red Hat Enterprise Linux Troubleshooting Guide.\",\"url\":\"https:\/\/www.webcodegeeks.com\/author\/benjamin-cane\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"3 Different Ways to Provide Docker Build Context - Web Code Geeks - 2026","description":"One of the powerful things about Docker is that it is possible for someone to use Docker every day without ever having to create their own custom","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/","og_locale":"en_US","og_type":"article","og_title":"3 Different Ways to Provide Docker Build Context - Web Code Geeks - 2026","og_description":"One of the powerful things about Docker is that it is possible for someone to use Docker every day without ever having to create their own custom","og_url":"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_published_time":"2017-09-28T09:15:52+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","type":"image\/jpeg"}],"author":"Benjamin Cane","twitter_card":"summary_large_image","twitter_creator":"@webcodegeeks","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Benjamin Cane","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/"},"author":{"name":"Benjamin Cane","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/4f5d918df9c19fab91b5b205357ce0b8"},"headline":"3 Different Ways to Provide Docker Build Context","datePublished":"2017-09-28T09:15:52+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/"},"wordCount":873,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","keywords":["Docker"],"articleSection":["DevOps"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/","url":"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/","name":"3 Different Ways to Provide Docker Build Context - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","datePublished":"2017-09-28T09:15:52+00:00","description":"One of the powerful things about Docker is that it is possible for someone to use Docker every day without ever having to create their own custom","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/devops\/3-different-ways-provide-docker-build-context\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"DevOps","item":"https:\/\/www.webcodegeeks.com\/category\/devops\/"},{"@type":"ListItem","position":3,"name":"3 Different Ways to Provide Docker Build Context"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/4f5d918df9c19fab91b5b205357ce0b8","name":"Benjamin Cane","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/09c6af2f1a7430456089189937094b817ef1b7c75ab9968bfd3ec35d938d914b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/09c6af2f1a7430456089189937094b817ef1b7c75ab9968bfd3ec35d938d914b?s=96&d=mm&r=g","caption":"Benjamin Cane"},"description":"Benjamin Cane is a systems architect in the financial services industry. He writes about Linux systems administration on his blog and has recently published his first book, Red Hat Enterprise Linux Troubleshooting Guide.","url":"https:\/\/www.webcodegeeks.com\/author\/benjamin-cane\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/18758","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/158"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=18758"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/18758\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/10356"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=18758"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=18758"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=18758"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}