apisix-ingress-controller
apisix-ingress-controller copied to clipboard
test: Discuss how to face the docker compose update
Issue description
When I was preparing to build the development environment on my new host, I was surprised to find a simple ci build problem after running the make-e2e-test-local command.
This is easy to fix, the official command seems to have been updated from docker-compose
to docker compose
.
I can install an older version of Docker Compose, or just modify the makefile to fix it. But for future compatibility. I suggest to think about rewriting part of the logic on this side?
So do we need to have a discussion about this situation?
Environment
- your apisix-ingress-controller version (output of apisix-ingress-controller version --long):
- your Kubernetes cluster version (output of kubectl version):
- if you run apisix-ingress-controller in Bare-metal environment, also show your OS version (uname -a):
Minimal test code / Steps to reproduce
- run the command
make e2e-test-local
;
Actual result
./test/e2e/testdata/wolf-rbac/cmd.sh: line 33: docker-compose: command not found
./test/e2e/testdata/wolf-rbac/cmd.sh: line 36: docker-compose: command not found
curl: (7) Failed connect to 127.0.0.1:12180; Connection refused
curl: (7) Failed connect to 127.0.0.1:12180; Connection refused
curl: (7) Failed connect to 127.0.0.1:12180; Connection refused
make: *** [e2e-wolf-rbac] Error 7
Error log
none
Expected result
Success!
You have not installed docker-compose. Or you can try to fix it
First, I have installed Docker Compose!
@AlinsRan
Maybe I didn't express myself clearly. What I meant was that the latest version of docker compose executes the command docker compose
instead of docker-compose
. So do we have to improve the makefile to accommodate this change. Or does anyone have a better suggestion?
First, I have installed Docker Compose!
@AlinsRan Maybe I didn't express myself clearly. What I meant was that the latest version of docker compose executes the command
docker compose
instead ofdocker-compose
. So do we have to improve the makefile to accommodate this change. Or does anyone have a better suggestion?
Hello, @Chever-John.
I went through the Docker documentation and noticed the following passage
Run docker compose up and the Docker compose command starts and runs your entire app. You can alternatively run docker-compose up using Compose standalone(docker-compose binary).
I think the problem here is that the new version of docker integrates the compose
command and you are trying to use the new way, but docker also supports the old version of docker-compose
. considering the compatibility with the old version, I think it is better to keep the current approach.
Feel free to point out if I'm wrong in my description.
Here you can simply add a conditional judgment.
Determine if there is a docker-compose
command on the machine.
Or check if any compose
plugin has been installed.
I think what is needed here is compatibility, not replacement.
@zaunist Thanks for your document which is very important.
@tao12345666333 Agree!
We could use the following code to check if the docker compose
exist.
if command -v "docker compose" > /dev/null 2>&1; then
alias docker-compose='docker compose'
fi
Copyright by openai :-)
Update: It does not work.
@AlinsRan Issue to be closed since PRs merged?
Yeah. My negligence. PR #1808 has been merged, I will close this issues.