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

Docker compose not working in windows-2019 agent pool. Checked with all the methods still no progress. Can you suggest me how to overcome this issue #7211

Closed
crsreddy1447 opened this issue Mar 1, 2023 · 1 comment

Comments

@crsreddy1447
Copy link

crsreddy1447 commented Mar 1, 2023

Description

Hi,
we are facing an issue when running docker compose task in azure devops with windows-2019 as agent pool.
Error: ##[error]The current Compose file version is not compatible with your engine version. Please upgrade your Compose file to a more recent version, or set a COMPOSE_API_VERSION in your environment.

Till Feb1 it worked fine in windows-2019. After that getting above error.

docker-compose-test.yml

version: '3.4'
services:
  mss-spfdev:
    image: containerregistry.azurecr.io/sqlserver:testlatest
    ports:
      - "1433:1433"
    container_name: test-dev

Azure Yaml template:

"
steps:

- task: VisualStudioTestPlatformInstaller@1
  displayName: 'Visual Studio Test Platform Installer'

- task: DeleteFiles@1
  displayName: 'Delete files from $(Build.SourcesDirectory)/.git'
  inputs:
    SourceFolder: '$(Build.SourcesDirectory)/.git'
    Contents: "**"

- task: DockerCompose@0
  displayName: 'Run a Docker Compose command'
  inputs:
    containerregistrytype: 'Container Registry'
    dockerRegistryEndpoint: testcontainerregistry
    dockerComposeFile: "docker-compose-test.yml"
    dockerComposeCommand: up -d

"
Here we are getting above error.

Few outputs

Docker Version is
Client:
 Version:           23.0.1
 API version:       1.42
 Go version:        go1.19.5
 Git commit:        a5ee5b1
 Built:             Thu Feb  9 19:50:24 2023
 OS/Arch:           windows/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          23.0.1
  API version:      1.42 (minimum version 1.24)
  Go version:       go1.19.5
  Git commit:       bc3805a0
  Built:            Thu Feb  9 19:46:43 2023
  OS/Arch:          windows/amd64
  Experimental:     false
Docker choco Compose Version is
docker-compose version 1.29.2, build 5becea4c

Also tried using compose path in task

    - task: DockerCompose@0
      displayName: 'Run a Docker Compose command'
      inputs:
        containerregistrytype: 'Container Registry'
        dockerRegistryEndpoint: 'testcontainerregistry'
        dockerComposeFile: '$(System.DefaultWorkingDirectory)/docker-compose-test.yml'
        dockerComposeFileArgs: 'COMPOSE_API_VERSION=''1.38'''
        action: 'Run a Docker Compose command'
        dockerComposeCommand: 'up -d'
        dockerComposePath: 'C:\Program Files\docker\docker-compose.exe'

getting error like

**Using docker-compose from 'dockerComposePath' 
##[error]The process 'C:\ProgramData\docker\cli-plugins\docker-compose.exe' failed with exit code 1
```**

How can I run Docker compose in windows-2019 agent pool?

### Platforms affected

- [X] Azure DevOps
- [ ] GitHub Actions - Standard Runners
- [ ] GitHub Actions - Larger Runners

### Runner images affected

- [ ] Ubuntu 18.04
- [ ] Ubuntu 20.04
- [ ] Ubuntu 22.04
- [ ] macOS 11
- [ ] macOS 12
- [X] Windows Server 2019
- [X] Windows Server 2022

### Image version and build link

NA

### Is it regression?

Windows-2019

### Expected behavior

Need to deploy docker compose

### Actual behavior

Only image is getting pulled. But not executed

### Repro steps

1. Used windows-2022 same issue
2. Used different compose version 3.8 instead of 3.4 in compose file 
3. used docker compose path 
4. used compose_api_version in env variables
5. used powershell to install docker latest version
@mikhailkoliada
Copy link
Contributor

Duplicate of #7162, it has all the explanation you need I guess :)

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

No branches or pull requests

2 participants