Increased Docker memory size and now docker compose wont work
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
|
show 3 more comments
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
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
|
show 3 more comments
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
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
wordpress docker docker-compose
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
|
show 3 more comments
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
|
show 3 more comments
2 Answers
2
active
oldest
votes
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.
add a comment |
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:
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
answered Jan 2 at 19:08
Baklap4Baklap4
1,72811236
1,72811236
add a comment |
add a comment |
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:
add a comment |
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:
add a comment |
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:
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:
answered Jan 2 at 19:07


varnitvarnit
1,297519
1,297519
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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