{
    "componentChunkName": "component---src-templates-post-js",
    "path": "/pensieve/docker-error",
    "result": {"data":{"markdownRemark":{"html":"<h2>Problem</h2>\n<p>Recently while updating with <a href=\"https://github.com/Upstatement/skela-wp-theme\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Skela</a> with webpack, I encountered a weird error where I wasn't able to run a simple script:</p>\n<div class=\"gatsby-code-title\">bin/composer</div>\n<div class=\"gatsby-highlight\" data-language=\"shell\"><pre class=\"language-shell\"><code class=\"language-shell\"><span class=\"token shebang important\">#!/bin/bash</span>\n<span class=\"token function\">docker-compose</span> <span class=\"token builtin class-name\">exec</span> <span class=\"token parameter variable\">-w</span> /var/www/html/wp-content/themes/skela wordpress <span class=\"token function\">composer</span> <span class=\"token string\">\"<span class=\"token variable\">$@</span>\"</span></code></pre></div>\n<p>When trying to run this script via <code class=\"language-text\">./bin/composer install</code>, I got this error in my terminal:</p>\n<div class=\"gatsby-highlight\" data-language=\"shell\"><pre class=\"language-shell\"><code class=\"language-shell\">ERROR: Setting workdir <span class=\"token keyword\">for</span> <span class=\"token builtin class-name\">exec</span> is not supported <span class=\"token keyword\">in</span> API <span class=\"token operator\">&lt;</span> <span class=\"token number\">1.35</span> <span class=\"token punctuation\">(</span><span class=\"token number\">1.30</span><span class=\"token punctuation\">)</span></code></pre></div>\n<p>The error was coming from the <code class=\"language-text\">-w</code> flag in the <code class=\"language-text\">docker-compose exec</code> command in the <code class=\"language-text\">composer</code> script.</p>\n<h2>Solution</h2>\n<p>Turns The fix was to update the version in my <code class=\"language-text\">docker-compose.yml</code> file to from version <code class=\"language-text\">3.5</code> to <code class=\"language-text\">3.6</code>. It's strange because 3.5 isn't anywhere close to the API version <code class=\"language-text\">1.35</code> from the error message 🤷‍♀️</p>\n<div class=\"gatsby-code-title\">docker-compose.yml</div>\n<div class=\"gatsby-highlight\" data-language=\"yaml\"><pre class=\"language-yaml\"><code class=\"language-yaml\"><span class=\"gatsby-highlight-code-line\"><span class=\"token key atrule\">version</span><span class=\"token punctuation\">:</span> <span class=\"token string\">'3.6'</span></span><span class=\"token key atrule\">services</span><span class=\"token punctuation\">:</span>\n  <span class=\"token key atrule\">wordpress</span><span class=\"token punctuation\">:</span>\n    build<span class=\"token punctuation\">:</span></code></pre></div>","frontmatter":{"title":"Docker Compose Error","description":"docker-compose version discrepancies","date":"2019-12-13","slug":"/pensieve/docker-error","tags":["WordPress","Docker"]}}},"pageContext":{}},
    "staticQueryHashes": ["1994492073","2009693873","2031412112","3825832676"]}