externpro / buildpro

build images for projects that use externpro
MIT License
2 stars 1 forks source link

docker compose V1 obsolete #46

Closed smanders closed 1 year ago

smanders commented 1 year ago

https://docs.docker.com/compose/install/

From the end of June 2023 Compose V1 won’t be supported anymore and will be removed from all Docker Desktop versions.

smanders commented 1 year ago

after switching all docker-compose usage to docker compose in the .devcontainer/compose.*.sh scripts, I saw the following error

parsing /home/smanders/src/pros/buildpro/docker-compose.yml: yaml: unmarshal errors:
  line 32: mapping key "<<" already defined at line 31

which appears to be fixed by combining the lines https://forum.mayan-edms.com/t/docker-compose-upgrade-to-2-17-0-breaks-yaml-config/334

smanders commented 1 year ago

NOTE: docker compose v2 changes to - where docker-compose v1 used _

docker images (-bld built with docker compose v2, _bld built with docker-compose v1)

buildpro-bld       latest    a4069beaef7a   36 minutes ago   10.5GB
buildpro_bld       latest    0e6f7152cd9b   4 hours ago      10.5GB

https://stackoverflow.com/questions/69464001/docker-compose-container-name-use-dash-instead-of-underscore

smanders commented 1 year ago

Migrate to Compose V2 https://docs.docker.com/compose/migrate/

explains the reason for changing from _ to -

Underscores are not valid characters in DNS hostnames. By using a hyphen instead, Compose V2 ensures service containers can be accessed over the network via consistent, predictable hostnames.

smanders commented 1 year ago

https://docs.docker.com/compose/install/

smanders commented 1 year ago

when projects have completely migrated to using docker compose over docker-compose (by updating buildpro scripts they are utilizing in all supported releases), the docker-compose standalone executable can/could be removed from the host system -- a note indicating this would be convenient

smanders commented 1 year ago

a convenient command to run that will verify docker compose support is installed and ready to take advantage of

docker compose version
smanders commented 1 year ago

after testing this on Windows/WSL2 I've decided to ditch the note https://github.com/smanders/buildpro/issues/46#issuecomment-1629884625 because docker-compose comes bundled with Docker Desktop and therefore can't be removed from the host system

smanders commented 1 year ago

I believe this issue is complete with commits referenced above... time and testing will tell!

smanders commented 1 year ago

running ./docker-compose.sh in CommonLibraries produces the error

invalid project name "CommonLibraries": must consist only of lowercase alphanumeric characters, hyphens, and underscores as well as start with a letter or number
smanders commented 1 year ago

latest issue (invalid project name) fixed with commit referenced above