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

Unsupported Compose File Version 3.6 error reported for Kubernetes while worked for Swarm #3014

Closed
2 tasks
ajeetraina opened this issue Jun 19, 2018 · 5 comments

Comments

@ajeetraina
Copy link

ajeetraina commented Jun 19, 2018

I am using the latest Docker for Mac 18.05.0 CE Edge Release with Kubernetes v1.10.3. While I have Swarm chosen as orchestrator, I can use Docker Compose version 3.6 successfully and it brings up the services.

Steps to reproduce the behavior

Environment:

  • Docker for Mac 18.05.0 CE Edge Release
  • Context: docker-for-desktop
[Captains-Bay]🚩 >  kubectl version
Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.6", GitCommit:"6260bb08c46c31eea6cb538b34a9ceb3e406689c", GitTreeState:"clean", BuildDate:"2017-12-21T06:34:11Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.3", GitCommit:"2bba0127d85d5a46ab4b778548be28623b32d0b0", GitTreeState:"clean", BuildDate:"2018-05-21T09:05:37Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
[Captains-Bay]🚩 >

Here is my simple docker-compose.yml file:

[Captains-Bay]🚩 >  cat docker-compose.yml
version: '3.6'
services:
  web1:
    image: nginx:alpine
    ports:
      - 8085:80
  db1:
    image: nginx:alpine
[Captains-Bay]🚩 >  docker version
Client:
 Version:      18.05.0-ce
 API version:  1.37
 Go version:   go1.9.5
 Git commit:   f150324
 Built:        Wed May  9 22:12:05 2018
 OS/Arch:      darwin/amd64
 Experimental: true
 Orchestrator: swarm

Server:
 Engine:
  Version:      18.05.0-ce
  API version:  1.37 (minimum version 1.12)
  Go version:   go1.10.1
  Git commit:   f150324
  Built:        Wed May  9 22:20:16 2018
  OS/Arch:      linux/amd64
  Experimental: true
[Captains-Bay]🚩 >  docker stack deploy -c docker-compose.yml mytry
Creating network mytry_default
Creating service mytry_db1
Creating service mytry_web1
[Captains-Bay]🚩 >  docker service ls
ID                  NAME                MODE                REPLICAS            IMAGE               PORTS
ualf5i0le078        mytry_db1           replicated          0/1                 nginx:alpine
i5l3adg46ioi        mytry_web1          replicated          0/1                 nginx:alpine        *:8084->80/tcp
[Captains-Bay]🚩 >  clear

Till now, things looked really good. Let me switch Swarm to Kubernetes.

[Captains-Bay]🚩 >  docker version
Client:
 Version:      18.05.0-ce
 API version:  1.37
 Go version:   go1.9.5
 Git commit:   f150324
 Built:        Wed May  9 22:12:05 2018
 OS/Arch:      darwin/amd64
 Experimental: true
 Orchestrator: kubernetes

Server:
 Engine:
  Version:      18.05.0-ce
  API version:  1.37 (minimum version 1.12)
  Go version:   go1.10.1
  Git commit:   f150324
  Built:        Wed May  9 22:20:16 2018
  OS/Arch:      linux/amd64
  Experimental: true
 Kubernetes:
  Version:     v1.10.3
  StackAPI:                   v1beta1
[Captains-Bay]🚩 >

Now while I try to use the same docker stack deploy CLI, it throws error:

[Captains-Bay]🚩 >  docker stack deploy -c docker-compose.yml myapp10
Stack.compose.docker.com "myapp10" is invalid: myapp10: Invalid value: "null": parsing error: unsupported Compose file version: 3.6
  • I have tried with the latest version of my channel (Stable or Edge)
    Yes

  • I have uploaded Diagnostics
    No

  • Diagnostics ID:
    N/A

Expected behavior

The same Docker stack CLI should work both for Swarm and Kubernetes

Actual behavior

The docker stack works for Swarm cluster BUT not for Kubernetes.

Information

  • macOS Version:

Diagnostic logs

Docker for Mac: version...
18.05.0 CE Edge
@vdemeester
Copy link

Hey @ajeetraina, thanks for the report 👼

This is to be expected with v1beta1 api version. That API version doesn't support the most recent composefile format, the support stops at 3.4 — and as composefile parsing is done server side (that's not the case for docker stack deploy on swarm), it won't support new versions.

The v1beta2 api version works differently as it's the responsability of the cli to convert the compose format into a specific struct, making at immune to that problem. The support for v1beta2 in the docker cli should be there in 18.06 GA (see docker/cli#899 for the PR that added that support).

@djs55
Copy link
Contributor

djs55 commented Jun 21, 2018

I've added the status/1-acknowledged issue and we can try again when the 18.06 RC is released in an edge build.

@ajeetraina
Copy link
Author

ajeetraina commented Jun 21, 2018

@vdemeester Verified it with Compose file format 3.4 and it works great.

[Captains-Bay]🚩 >  docker version
Client:
 Version:      18.05.0-ce
 API version:  1.37
 Go version:   go1.9.5
 Git commit:   f150324
 Built:        Wed May  9 22:12:05 2018
 OS/Arch:      darwin/amd64
 Experimental: true
 Orchestrator: kubernetes

Server:
 Engine:
  Version:      18.05.0-ce
  API version:  1.37 (minimum version 1.12)
  Go version:   go1.10.1
  Git commit:   f150324
  Built:        Wed May  9 22:20:16 2018
  OS/Arch:      linux/amd64
  Experimental: true
 Kubernetes:
  Version:     v1.10.3
  StackAPI:                   v1beta1
$docker stack deploy -c docker-compose.yml myapp11
Stack myapp11 was created
Waiting for the stack to be stable and running...
 - Service db1 has one container running
 - Service web1 has one container running
Stack myapp11 is stable and running

Thanks @djs55 for adding it to the right bucket.

@docker-robott
Copy link
Collaborator

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Jun 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants