Open Debianer opened 3 months ago
I believe all of the documentation + examples should be updated but this also means some files needs to be renamed. I've been using docker compose
in place of docker-compose
since docker put up the notices for the v1 syntax.
Compose nowadays use compose.yaml
or compose.yml
as filename, where everything here mentions docker-compose.yml
and in very rare edge cases having docker-compose.yml
as file can cause problems. It has been a while since i migrated from v1 to v2 but i don't remember having any data loss from that change, and the named volumes i had were working fine. The only imporant thing is to do docker-compose down
before doing docker compose up -d
(note the dashes in the command and the order of execution) and it should be fine.
Yeah I sort of mentally transitioned from docker-compose
to docker compose
so long ago that I don't even see the old references in the docs. :-)
There are issues with transitioning, which Docker documents here:
https://docs.docker.com/compose/migrate/
And there's a --compatibility
flag that helps some:
https://docs.docker.com/compose/migrate/#migrating-running-projects
I've wanted to clean up the docs and drop all references docker-compose
/ docker-compose.yml
(and related adjustments) but haven't because I hadn't been devoted enough to going back and thinking about how to convey the transition impact possibilities for those that have existing deployments (brought up with docker-compose
et al). I saw @tzerber has been attempting some improvements in this area, but I haven't had the time to look those over myself.
Problem
When using
docker-compose up -d
after usingdocker-compose pull
(as per documentation) to upgrade containers, the setup stops working and containers don't come up. The main problem seems to be the Redis container throwing a bunch of error messages, more information below.Solution/Workaround
Use the command
docker-compose down
beforedocker-compose up -d
, as in:Pretty much the whole issue as well as suggested solutions are described here:
[Docker-compose giving 'ContainerConfig' errors after update today](https://askubuntu.com/questions/1508129/docker-compose-giving-containerconfig-errors-after-update-today)
I will copy and paste some stuff from the link, so people can find this.
When I run sudo docker-compose up -d, I get the following output:
Alas, my attempt at fixing this problem using the new command "docker compose" without the hyphen resulted in a set of new volume folders for the persistent data, which were empty. The old ones were still there. Because "docker compose" uses a new syntax for creating names of volume folders.
So when moving from "docker-compose" to "docker compose", I guess everyone will either need to rename their folders for persistent data (does this actually work?) or change the yaml file to point to the exact locations. My configuration still mirrors the example. It currently looks like this:
The resulting folder is named as such:
dockernextcloud_nextcloud
The "docker compose" command on the same yaml creates a new folder from scratch with this name:
docker_nextcloud_nextcloud