when using docker compose 3.8 getting 'version is unsupported' error
Asked Answered
K

5

23

I'm trying to use the latest docker compose version 3.8 but I keep getting "Version in ".\docker-compose.yml" is unsupported." error.

I'm using the latest version of Docker engine, 19.03.8 and Docker desktop, 2.2.0.5.

EDIT: Here is my docker compose version: docker-compose version 1.25.4, build 8d51620a

Here is my docker compose file:

version: "3.8"
services:
  portal:
    image: portal-dev
    ports:
      - "5000:80"
      - "4200:4200"
    container_name: portal
    build:
      context: .
      dockerfile: Dockerfile.dev
    environment:
      ASPNETCORE_ENVIRONMENT: Development
      DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER: 0

My docker compose file works using version 3.7. I can't figure out why it doesn't work using version 3.8. Can anyone help?

Kowloon answered 21/4, 2020 at 13:37 Comment(2)
could you add output of docker-compose version to your question ?Clegg
@Clegg I added my version of docker-compose.Kowloon
B
25

The 3.8 compose version was added in docker-compose 1.25.5 (ref: https://github.com/docker/compose/releases/tag/1.25.5 )

Docker Desktop 2.3 include the new version of compose but it's on the edge channel for now.

If you can/doesn't want to use the Edge Channel, you can download the latest version of docker-compose manually on the github release page https://github.com/docker/compose/releases

Blastema answered 21/4, 2020 at 19:52 Comment(2)
Oh that's why. Thanks. The Docker website is misleading showing an example with 3.8 thinking its the current version when it really isn't.Kowloon
I wonder why by default an outdated version is installed. That seems to be a trend.Walsingham
L
13

Follow the below steps to resolve the issue:

  • Uninstall docker-compose (if installed)
    sudo apt-get remove docker-compose -y
    
  • Get latest binary version of docker-compose from github releases
    curl -O -J -L https://github.com/docker/compose/releases/download/v2.11.2/docker-compose-linux-x86_64
    
  • Make the binary executable.
chmod +x docker-compose-linux-x86_64
  • Add this to binary look up location.
sudo cp ./docker-compose-linux-x86_64 /usr/bin/docker-compose
  • check version
docker-compose version
Lidia answered 19/10, 2022 at 4:35 Comment(0)
B
0

in my case, i solved via replace the version to 3.3 as the error log shows.

my docker compose is located at: /usr/bin/docker-compose

and its version is: docker-compose version 1.20.0, build xxxxxx

I totally agree the docker official website is misleading with the incorrect matched version with 3.9 for me.

Byrdie answered 22/9, 2022 at 18:48 Comment(0)
P
0

In my case, I lost the customal location settings in the first place, I configure the location like this and it works:

{
  "id": 1,
  "created_on": "2023-11-04 18:48:54",
  "modified_on": "2023-11-04 20:52:05",
  "owner_user_id": 1,
  "domain_names": [
    "likegiver.com"
  ],
  "forward_host": "8.219.255.71",
  "forward_port": 81,
  "access_list_id": 0,
  "certificate_id": 7,
  "ssl_forced": true,
  "caching_enabled": false,
  "block_exploits": false,
  "advanced_config": "",
  "meta": {
    "letsencrypt_agree": false,
    "dns_challenge": false
  },
  "allow_websocket_upgrade": true,
  "http2_support": false,
  "forward_scheme": "http",
  "enabled": 1,
  "locations": [
    {
      "path": "/game",
      "advanced_config": "",
      "forward_scheme": "http",
      "forward_host": "8.219.255.71/game",
      "forward_port": 8000
    }
  ],
  "hsts_enabled": false,
  "hsts_subdomains": false
}

I use the nginx as a reverse proxy so that I don't need to use http://likegiver.com:8000/game to visit my website. I can use https://likegiver.com/game instead.

Pica answered 5/11, 2023 at 4:38 Comment(0)
C
0

Answer of "DilLip_Chowdary" is the best solution also for me on Debian. After doing this it is needed to restart docker daemon. Please check before which containers are running, they should be restarted after.

sudo systemctl restart docker

You can define Container's behavior in docker-compose file with restart: [restart command]

Check answered 6/8 at 13:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.