Increased Docker memory size and now docker compose wont work












1















I increased my docker for windows CPU and memory size in settings, and it did a restart, then I tried to run docker-compose up -d on my project and I got the following error ERROR: Named volume "C:/Users/andersk/sites/sylr:/var/www/html" is used in service "wordpress" but no declaration was found in the volumes section.



Here is my docker compose file, it was working just fine up until I increased those settings in the docker.



version: '3.3'

services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress

wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- "2000:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
volumes:
- C:/Users/andersk/sites/sylr:/var/www/html
volumes:
db_data: {}









share|improve this question


















  • 1





    Are you using docker-compose from CMD or WSL? And didn't you accidentally also update docker-compose? What version are you using?

    – michalhosna
    Jan 2 at 18:57











  • Buddy you need to declare the volume in your volume section

    – varnit
    Jan 2 at 18:57











  • I am such an idiot I was running it under wsl and was supposed to be in powershell

    – Anders Kitson
    Jan 2 at 19:00











  • @AndersKitson it may run in wsl however you'll need to change your path to /mnt/c/Users/Andersk/sites/sylr:/var/www/html or use a relative path. Another option would be to create a docker volume container, and link it as @varnit says

    – Baklap4
    Jan 2 at 19:01













  • Should I just delete this question I don't see this helping anyone, maybe it will

    – Anders Kitson
    Jan 2 at 19:04
















1















I increased my docker for windows CPU and memory size in settings, and it did a restart, then I tried to run docker-compose up -d on my project and I got the following error ERROR: Named volume "C:/Users/andersk/sites/sylr:/var/www/html" is used in service "wordpress" but no declaration was found in the volumes section.



Here is my docker compose file, it was working just fine up until I increased those settings in the docker.



version: '3.3'

services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress

wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- "2000:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
volumes:
- C:/Users/andersk/sites/sylr:/var/www/html
volumes:
db_data: {}









share|improve this question


















  • 1





    Are you using docker-compose from CMD or WSL? And didn't you accidentally also update docker-compose? What version are you using?

    – michalhosna
    Jan 2 at 18:57











  • Buddy you need to declare the volume in your volume section

    – varnit
    Jan 2 at 18:57











  • I am such an idiot I was running it under wsl and was supposed to be in powershell

    – Anders Kitson
    Jan 2 at 19:00











  • @AndersKitson it may run in wsl however you'll need to change your path to /mnt/c/Users/Andersk/sites/sylr:/var/www/html or use a relative path. Another option would be to create a docker volume container, and link it as @varnit says

    – Baklap4
    Jan 2 at 19:01













  • Should I just delete this question I don't see this helping anyone, maybe it will

    – Anders Kitson
    Jan 2 at 19:04














1












1








1








I increased my docker for windows CPU and memory size in settings, and it did a restart, then I tried to run docker-compose up -d on my project and I got the following error ERROR: Named volume "C:/Users/andersk/sites/sylr:/var/www/html" is used in service "wordpress" but no declaration was found in the volumes section.



Here is my docker compose file, it was working just fine up until I increased those settings in the docker.



version: '3.3'

services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress

wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- "2000:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
volumes:
- C:/Users/andersk/sites/sylr:/var/www/html
volumes:
db_data: {}









share|improve this question














I increased my docker for windows CPU and memory size in settings, and it did a restart, then I tried to run docker-compose up -d on my project and I got the following error ERROR: Named volume "C:/Users/andersk/sites/sylr:/var/www/html" is used in service "wordpress" but no declaration was found in the volumes section.



Here is my docker compose file, it was working just fine up until I increased those settings in the docker.



version: '3.3'

services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress

wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- "2000:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
volumes:
- C:/Users/andersk/sites/sylr:/var/www/html
volumes:
db_data: {}






wordpress docker docker-compose






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 2 at 18:52









Anders KitsonAnders Kitson

453732




453732








  • 1





    Are you using docker-compose from CMD or WSL? And didn't you accidentally also update docker-compose? What version are you using?

    – michalhosna
    Jan 2 at 18:57











  • Buddy you need to declare the volume in your volume section

    – varnit
    Jan 2 at 18:57











  • I am such an idiot I was running it under wsl and was supposed to be in powershell

    – Anders Kitson
    Jan 2 at 19:00











  • @AndersKitson it may run in wsl however you'll need to change your path to /mnt/c/Users/Andersk/sites/sylr:/var/www/html or use a relative path. Another option would be to create a docker volume container, and link it as @varnit says

    – Baklap4
    Jan 2 at 19:01













  • Should I just delete this question I don't see this helping anyone, maybe it will

    – Anders Kitson
    Jan 2 at 19:04














  • 1





    Are you using docker-compose from CMD or WSL? And didn't you accidentally also update docker-compose? What version are you using?

    – michalhosna
    Jan 2 at 18:57











  • Buddy you need to declare the volume in your volume section

    – varnit
    Jan 2 at 18:57











  • I am such an idiot I was running it under wsl and was supposed to be in powershell

    – Anders Kitson
    Jan 2 at 19:00











  • @AndersKitson it may run in wsl however you'll need to change your path to /mnt/c/Users/Andersk/sites/sylr:/var/www/html or use a relative path. Another option would be to create a docker volume container, and link it as @varnit says

    – Baklap4
    Jan 2 at 19:01













  • Should I just delete this question I don't see this helping anyone, maybe it will

    – Anders Kitson
    Jan 2 at 19:04








1




1





Are you using docker-compose from CMD or WSL? And didn't you accidentally also update docker-compose? What version are you using?

– michalhosna
Jan 2 at 18:57





Are you using docker-compose from CMD or WSL? And didn't you accidentally also update docker-compose? What version are you using?

– michalhosna
Jan 2 at 18:57













Buddy you need to declare the volume in your volume section

– varnit
Jan 2 at 18:57





Buddy you need to declare the volume in your volume section

– varnit
Jan 2 at 18:57













I am such an idiot I was running it under wsl and was supposed to be in powershell

– Anders Kitson
Jan 2 at 19:00





I am such an idiot I was running it under wsl and was supposed to be in powershell

– Anders Kitson
Jan 2 at 19:00













@AndersKitson it may run in wsl however you'll need to change your path to /mnt/c/Users/Andersk/sites/sylr:/var/www/html or use a relative path. Another option would be to create a docker volume container, and link it as @varnit says

– Baklap4
Jan 2 at 19:01







@AndersKitson it may run in wsl however you'll need to change your path to /mnt/c/Users/Andersk/sites/sylr:/var/www/html or use a relative path. Another option would be to create a docker volume container, and link it as @varnit says

– Baklap4
Jan 2 at 19:01















Should I just delete this question I don't see this helping anyone, maybe it will

– Anders Kitson
Jan 2 at 19:04





Should I just delete this question I don't see this helping anyone, maybe it will

– Anders Kitson
Jan 2 at 19:04












2 Answers
2






active

oldest

votes


















1














If ran from WSL one can change your docker-compose.yml to the following



version: '3.3'
services:
wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- "2000:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
volumes:
- /mnt/c/Users/andersk/sites/sylr:/var/www/html


Note the prefix /mnt/c instead of C:/



Another method would be to use a relative path or create a named volume like:



version: '3.3'
services:
wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- "2000:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
volumes:
- some_volume_name:/var/www/html
volumes:
some_volume_name: {}


If ran from Powershell it should work just out of the box.






share|improve this answer































    1














    You can use docker named volume in place and share that name across multiple containers, it would also make debugging easier



    version: "3"

    services:
    db:
    image: db
    volumes:
    - data-volume:/var/lib/db
    backup:
    image: backup-service
    volumes:
    - data-volume:/var/lib/backup/data

    volumes:
    data-volume:





    share|improve this answer
























      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54011665%2fincreased-docker-memory-size-and-now-docker-compose-wont-work%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1














      If ran from WSL one can change your docker-compose.yml to the following



      version: '3.3'
      services:
      wordpress:
      depends_on:
      - db
      image: wordpress:latest
      ports:
      - "2000:80"
      restart: always
      environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
      volumes:
      - /mnt/c/Users/andersk/sites/sylr:/var/www/html


      Note the prefix /mnt/c instead of C:/



      Another method would be to use a relative path or create a named volume like:



      version: '3.3'
      services:
      wordpress:
      depends_on:
      - db
      image: wordpress:latest
      ports:
      - "2000:80"
      restart: always
      environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
      volumes:
      - some_volume_name:/var/www/html
      volumes:
      some_volume_name: {}


      If ran from Powershell it should work just out of the box.






      share|improve this answer




























        1














        If ran from WSL one can change your docker-compose.yml to the following



        version: '3.3'
        services:
        wordpress:
        depends_on:
        - db
        image: wordpress:latest
        ports:
        - "2000:80"
        restart: always
        environment:
        WORDPRESS_DB_HOST: db:3306
        WORDPRESS_DB_USER: wordpress
        WORDPRESS_DB_PASSWORD: wordpress
        volumes:
        - /mnt/c/Users/andersk/sites/sylr:/var/www/html


        Note the prefix /mnt/c instead of C:/



        Another method would be to use a relative path or create a named volume like:



        version: '3.3'
        services:
        wordpress:
        depends_on:
        - db
        image: wordpress:latest
        ports:
        - "2000:80"
        restart: always
        environment:
        WORDPRESS_DB_HOST: db:3306
        WORDPRESS_DB_USER: wordpress
        WORDPRESS_DB_PASSWORD: wordpress
        volumes:
        - some_volume_name:/var/www/html
        volumes:
        some_volume_name: {}


        If ran from Powershell it should work just out of the box.






        share|improve this answer


























          1












          1








          1







          If ran from WSL one can change your docker-compose.yml to the following



          version: '3.3'
          services:
          wordpress:
          depends_on:
          - db
          image: wordpress:latest
          ports:
          - "2000:80"
          restart: always
          environment:
          WORDPRESS_DB_HOST: db:3306
          WORDPRESS_DB_USER: wordpress
          WORDPRESS_DB_PASSWORD: wordpress
          volumes:
          - /mnt/c/Users/andersk/sites/sylr:/var/www/html


          Note the prefix /mnt/c instead of C:/



          Another method would be to use a relative path or create a named volume like:



          version: '3.3'
          services:
          wordpress:
          depends_on:
          - db
          image: wordpress:latest
          ports:
          - "2000:80"
          restart: always
          environment:
          WORDPRESS_DB_HOST: db:3306
          WORDPRESS_DB_USER: wordpress
          WORDPRESS_DB_PASSWORD: wordpress
          volumes:
          - some_volume_name:/var/www/html
          volumes:
          some_volume_name: {}


          If ran from Powershell it should work just out of the box.






          share|improve this answer













          If ran from WSL one can change your docker-compose.yml to the following



          version: '3.3'
          services:
          wordpress:
          depends_on:
          - db
          image: wordpress:latest
          ports:
          - "2000:80"
          restart: always
          environment:
          WORDPRESS_DB_HOST: db:3306
          WORDPRESS_DB_USER: wordpress
          WORDPRESS_DB_PASSWORD: wordpress
          volumes:
          - /mnt/c/Users/andersk/sites/sylr:/var/www/html


          Note the prefix /mnt/c instead of C:/



          Another method would be to use a relative path or create a named volume like:



          version: '3.3'
          services:
          wordpress:
          depends_on:
          - db
          image: wordpress:latest
          ports:
          - "2000:80"
          restart: always
          environment:
          WORDPRESS_DB_HOST: db:3306
          WORDPRESS_DB_USER: wordpress
          WORDPRESS_DB_PASSWORD: wordpress
          volumes:
          - some_volume_name:/var/www/html
          volumes:
          some_volume_name: {}


          If ran from Powershell it should work just out of the box.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 2 at 19:08









          Baklap4Baklap4

          1,72811236




          1,72811236

























              1














              You can use docker named volume in place and share that name across multiple containers, it would also make debugging easier



              version: "3"

              services:
              db:
              image: db
              volumes:
              - data-volume:/var/lib/db
              backup:
              image: backup-service
              volumes:
              - data-volume:/var/lib/backup/data

              volumes:
              data-volume:





              share|improve this answer




























                1














                You can use docker named volume in place and share that name across multiple containers, it would also make debugging easier



                version: "3"

                services:
                db:
                image: db
                volumes:
                - data-volume:/var/lib/db
                backup:
                image: backup-service
                volumes:
                - data-volume:/var/lib/backup/data

                volumes:
                data-volume:





                share|improve this answer


























                  1












                  1








                  1







                  You can use docker named volume in place and share that name across multiple containers, it would also make debugging easier



                  version: "3"

                  services:
                  db:
                  image: db
                  volumes:
                  - data-volume:/var/lib/db
                  backup:
                  image: backup-service
                  volumes:
                  - data-volume:/var/lib/backup/data

                  volumes:
                  data-volume:





                  share|improve this answer













                  You can use docker named volume in place and share that name across multiple containers, it would also make debugging easier



                  version: "3"

                  services:
                  db:
                  image: db
                  volumes:
                  - data-volume:/var/lib/db
                  backup:
                  image: backup-service
                  volumes:
                  - data-volume:/var/lib/backup/data

                  volumes:
                  data-volume:






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 2 at 19:07









                  varnitvarnit

                  1,297519




                  1,297519






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54011665%2fincreased-docker-memory-size-and-now-docker-compose-wont-work%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      MongoDB - Not Authorized To Execute Command

                      How to fix TextFormField cause rebuild widget in Flutter

                      in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith