-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Make Docker Compose version check more forgiving #1132
Comments
this is a docker-compose question ? |
@mowangjuanzi We recently started supporting both v1 and v2 of Docker Compose, it's possible you've found a bug in how we implement that. Can you debug this further? Look in |
i not found but i found $ docker version
Client: Docker Engine - Community
Version: 20.10.10
API version: 1.41
Go version: go1.16.9
Git commit: b485636
Built: Mon Oct 25 07:43:58 2021
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.10
API version: 1.41 (minimum version 1.12)
Go version: go1.16.9
Git commit: e2f740d
Built: Mon Oct 25 07:42:04 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.11
GitCommit: 5b46e404f6b9f661a205e28d59c982d3634148f8
runc:
Version: 1.0.2
GitCommit: v1.0.2-0-g52b36a2
docker-init:
Version: 0.19.0
GitCommit: de40ad0
$ docker-compose version
Docker Compose version v2.0.1
$ git log -1
commit c16ae024dc3e8259b03679f950e80e1cbfb5dae8 (HEAD -> master, origin/master, origin/HEAD)
Author: Chad Whitacre <[email protected]>
Date: Tue Nov 2 10:59:13 2021 -0400
Fix #1079 - bug in reset.sh (#1134)
We need $0 to evaluate as install.sh in order for check-requirements to
work.
$ sh install/check-minimum-requirements.sh
Checking minimum requirements ...
install/check-minimum-requirements.sh: 3: source: not found
docker: 'compose' is not a docker command.
See 'docker --help'
unknown flag: --short
See 'docker --help'.
Usage: docker [OPTIONS] COMMAND
A self-sufficient runtime for containers
Options:
--config string Location of client config files (default "/home/mowangjuanzi/.docker")
-c, --context string Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and default context set with "docker context use")
-D, --debug Enable debug mode
-H, --host list Daemon socket(s) to connect to
-l, --log-level string Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info")
--tls Use TLS; implied by --tlsverify
--tlscacert string Trust certs signed only by this CA (default "/home/mowangjuanzi/.docker/ca.pem")
--tlscert string Path to TLS certificate file (default "/home/mowangjuanzi/.docker/cert.pem")
--tlskey string Path to TLS key file (default "/home/mowangjuanzi/.docker/key.pem")
--tlsverify Use TLS and verify the remote
-v, --version Print version information and quit
Management Commands:
app* Docker App (Docker Inc., v0.9.1-beta3)
builder Manage builds
buildx* Build with BuildKit (Docker Inc., v0.6.3-docker)
config Manage Docker configs
container Manage containers
context Manage contexts
image Manage images
manifest Manage Docker image manifests and manifest lists
network Manage networks
node Manage Swarm nodes
plugin Manage plugins
scan* Docker Scan (Docker Inc., v0.9.0)
secret Manage Docker secrets
service Manage services
stack Manage Docker stacks
swarm Manage Swarm
system Manage Docker
trust Manage trust on Docker images
volume Manage volumes
Commands:
attach Attach local standard input, output, and error streams to a running container
build Build an image from a Dockerfile
commit Create a new image from a container's changes
cp Copy files/folders between a container and the local filesystem
create Create a new container
diff Inspect changes to files or directories on a container's filesystem
events Get real time events from the server
exec Run a command in a running container
export Export a container's filesystem as a tar archive
history Show the history of an image
images List images
import Import the contents from a tarball to create a filesystem image
info Display system-wide information
inspect Return low-level information on Docker objects
kill Kill one or more running containers
load Load an image from a tar archive or STDIN
login Log in to a Docker registry
logout Log out from a Docker registry
logs Fetch the logs of a container
pause Pause all processes within one or more containers
port List port mappings or a specific mapping for the container
ps List containers
pull Pull an image or a repository from a registry
push Push an image or a repository to a registry
rename Rename a container
restart Restart one or more containers
rm Remove one or more containers
rmi Remove one or more images
run Run a command in a new container
save Save one or more images to a tar archive (streamed to STDOUT by default)
search Search the Docker Hub for images
start Start one or more stopped containers
stats Display a live stream of container(s) resource usage statistics
stop Stop one or more running containers
tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
top Display the running processes of a container
unpause Unpause all processes within one or more containers
update Update configuration of one or more containers
version Show the Docker version information
wait Block until one or more containers stop, then print their exit codes
Run 'docker COMMAND --help' for more information on a command.
To get more help with docker, check out our guides at https://docs.docker.com/go/guides/
install/check-minimum-requirements.sh: 17: Syntax error: "(" unexpected |
$ echo $(docker-compose --version | sed 's/docker-compose version \(.\{1,\}\),.*/\1/')
Docker Compose version v2.0.1 |
Sorry, that's what I meant, yes. :) Architectural Sidebar
The non-executable files in
Debugging the ProblemGoing over your initial report more carefully, I see a clue:
I hypothesize that the And I hypothesize that the Instead of this one: Can you confirm these hypotheses, please? :) If my hypotheses are correct, then the question is, why are you failing the check on line 7? We already have the output of |
yes. i think the execute result is the value is PS C:\Users\baogu\Downloads> docker-compose --version
Docker Compose version v2.0.0
PS C:\Users\baogu\Downloads> .\docker-compose-Windows-x86_64.exe --version
docker-compose version 1.29.2, build 5becea4c |
What's the output of |
PS C:\Users\baogu> docker compose version
Docker Compose version v2.0.0 I cannot execute |
Why not? That's presumably the reason you're failing the check on line 7. |
$ docker-compose version
Docker Compose version v2.0.1
$ docker compose version
docker: 'compose' is not a docker command.
See 'docker --help' operate system is ubuntu 21.10. $ docker version
Client: Docker Engine - Community
Version: 20.10.10
API version: 1.41
Go version: go1.16.9
Git commit: b485636
Built: Mon Oct 25 07:43:58 2021
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.10
API version: 1.41 (minimum version 1.12)
Go version: go1.16.9
Git commit: e2f740d
Built: Mon Oct 25 07:42:04 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.11
GitCommit: 5b46e404f6b9f661a205e28d59c982d3634148f8
runc:
Version: 1.0.2
GitCommit: v1.0.2-0-g52b36a2
docker-init:
Version: 0.19.0
GitCommit: de40ad0 |
It's too late. I'm going to bed。 good night. |
Curious. How did you end up with a v2 I'm going to go ahead and close this. It looks like you need to either downgrade |
From #1166 (comment):
|
Reopening, as @jsanagustin reports at #1166 (comment) that this is likely related to CentOS packaging:
Yeah okay now I'm waffling. :) |
I'm doing a little test of old docker versions.
#!/usr/bin/env zsh
for i in {0..29}; do
curl -L https://github.com/docker/compose/releases/download/1.$i.0/run.sh -o docker-compose-1.$i.0
done #!/usr/bin/env zsh
for i in {1..29}; do
./docker-compose-1.$i.0 version | head -n1
done |
Second run of
|
I removed the "Not found" versions.
|
Here's a parse pipe that seems to work: #!/usr/bin/env zsh
rm versions
for dc in docker-compose-$1*; do
./$dc version | head -n1 | sed 's/^.* version:\{0,1\} v\{0,1\}\([0-9.]\{1,\}\).*$/\1/'
done
Oh ... I also stubbed out a #!/usr/bin/env zsh
docker compose $@ Results:
I wrestled for a while with 1.5.0 ... I'm pretty sure there's a carriage return at the end that is boogering it up, I tried matching that in the sed regex but gave up, 1.5 is ancient, and this'll fail the version check anyway probably right? ¯\_(ツ)_/¯ |
Done in #1179. |
Version
21.10.0
Steps to Reproduce
Expected Result
Install Success.
Actual Result
▶ Parsing command line ...
▶ Setting up error handling ...
▶ Checking minimum requirements ...
FAIL: Expected minimum docker-compose version to be 1.28.0 but found Docker Compose version v2.0.1
The text was updated successfully, but these errors were encountered: