Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using docker-compose 2.9.0 #883

Closed
zgrannan opened this issue Aug 17, 2022 · 4 comments
Closed

Error using docker-compose 2.9.0 #883

zgrannan opened this issue Aug 17, 2022 · 4 comments

Comments

@zgrannan
Copy link

zgrannan commented Aug 17, 2022

After upgrading to docker-compose 2.9.0, the following error is encountered

debian@validate2:/home/debian/eth-docker# ./ethd restart
Invalid template: "$(git describe --tags $(git rev-list --tags --max-count=1))"
Invalid template: "$(git describe --tags $(git rev-list --tags --max-count=1))"

Version 2.6.1 doesn't have this problem, so that version can be used as a workaround. Perhaps the script could detect the docker version used and report an error for version >= 2.7? Or the format of the dockerfile could be changed...

Related: docker-archive/compose-cli#1896, docker/compose#9704

@yorickdowne
Copy link
Contributor

Can you tell me which client and Dockerfile this is, so I can test it? And thanks for the report!

@zgrannan
Copy link
Author

In my env file i have COMPOSE_FILE=prysm-base.yml:nethermind.yml, not sure about which Dockerfile specifically caused this (I've since reverted to docker-compose 2.6.1 to fix this). However, I suspect the occurrences of git describe --tags $(git rev-list --tags --max-count=1 in default.env are related:

debian@validate2:~/eth-docker$ ag 'rev-list'
default.env
134:TEKU_SRC_BUILD_TARGET=$(git describe --tags $(git rev-list --tags --max-count=1))
140:LH_SRC_BUILD_TARGET=$(git describe --tags $(git rev-list --tags --max-count=1))
146:PRYSM_SRC_BUILD_TARGET=$(git describe --tags $(git rev-list --tags --max-count=1))
152:LS_SRC_BUILD_TARGET=$(git describe --tags $(git rev-list --tags --max-count=1))
158:BESU_SRC_BUILD_TARGET=$(git describe --tags $(git rev-list --tags --max-count=1))
170:NM_SRC_BUILD_TARGET=$(git describe --tags $(git rev-list --tags --max-count=1))
176:GETH_SRC_BUILD_TARGET=$(git describe --tags $(git rev-list --tags --max-count=1))
188:DEPCLI_SRC_BUILD_TARGET=$(git describe --tags $(git rev-list --tags --max-count=1))

@yorickdowne
Copy link
Contributor

Those build targets are only used with source builds. I've successfully tested this with compose 1.9.2 on Ubuntu. On Debian 11 it's compose plugin 2.6.0 as brought in by docker-ce. Sounds like compose plugin 2.9.0 breaks this, which isn't great.

This is what should happen, as seen by docker compose config:

      args:
        BUILD_TARGET: $$(git describe --tags $$(git rev-list --tags --max-count=1))

OK so this is a deliberate change in v2. Doubling the $ will likely break previous compose. Maybe the " method will work. I'll take a look.

@yorickdowne
Copy link
Contributor

Single quotes do the trick. Please test again on the merge-getready branch, and thank you for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants