{"id":2259,"date":"2022-10-07T11:30:14","date_gmt":"2022-10-07T09:30:14","guid":{"rendered":"https:\/\/nguenkam.com\/blog\/?p=2259"},"modified":"2022-10-12T00:59:03","modified_gmt":"2022-10-11T22:59:03","slug":"fixes-error-unable-to-give-network-name-in-docker-compose","status":"publish","type":"post","link":"https:\/\/nguenkam.com\/blog\/index.php\/2022\/10\/07\/fixes-error-unable-to-give-network-name-in-docker-compose\/","title":{"rendered":"[ Fixes ] Error : Unable to give network name in docker-compose"},"content":{"rendered":"\n<p>When trying to create a network in docker-compose.yml :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>version: \"3.5\"\nnetworks:\n  frontend:\n    name: custom_frontend\n    driver: custom-driver-1<\/code><\/pre>\n\n\n\n<p>I faced to following issue: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ERROR: <span class=\"has-inline-color has-vivid-red-color\">The Compose file '.\/docker-compose.yml' is invalid because:\nnetworks.frontend value Additional properties are not allowed ('name' was unexpected)<\/span><\/code><\/pre>\n\n\n\n<p>I was using Docker-compose version 1.17.1<\/p>\n\n\n\n<p>This happened , because &nbsp;<code>docker-compose<\/code> release,&nbsp;I was using (1.17.1) is not support version&nbsp;<code>3.5<\/code> (<em>mentionned in docker-compose Yml file)<\/em>. <br>1.17.1 only supports up to 3.4:<\/p>\n\n\n\n<h5>How to fix it ?<\/h5>\n\n\n\n<p>You can run the following commands to upgrade&nbsp;<code>docker-compose<\/code>&nbsp;to a newer\/latest version, (for example&nbsp;<code>1.28.5<\/code>) :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -L https:\/\/github.com\/docker\/compose\/releases\/download\/1.28.5\/docker-compose-`uname -s`-`uname -m` -o \/usr\/local\/bin\/docker-compose\nchmod +x \/usr\/local\/bin\/docker-compose<\/code><\/pre>\n\n\n\n<p>(The commands were copied from the releases page)<\/p>\n\n\n\n<p>After upgrade, you can run&nbsp;<em><span class=\"has-inline-color has-vivid-cyan-blue-color\"><code>docker-compose -f &lt;your-compose-file&gt; config<\/code>&nbsp;<\/span><\/em>to check whether the compose file is valid. <strong>If your compose file is valid it&#8217;ll just print it out.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When trying to create a network in docker-compose.yml : I faced to following issue: I was using Docker-compose version 1.17.1 This happened , because &nbsp;docker-compose release,&nbsp;I was using (1.17.1) is not support version&nbsp;3.5 (mentionned in docker-compose Yml file). 1.17.1 only supports up to 3.4: How to fix it ? You can run the following commands [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2276,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[208,533],"tags":[616,547,349,614,615,618,617],"_links":{"self":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2259"}],"collection":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=2259"}],"version-history":[{"count":2,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2259\/revisions"}],"predecessor-version":[{"id":2277,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2259\/revisions\/2277"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/media\/2276"}],"wp:attachment":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=2259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=2259"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=2259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}