相关文章推荐
稳重的海豚  ·  错误:包org.openqa.seleniu ...·  1 年前    · 
文雅的小蝌蚪  ·  pandas dataframe plot ...·  1 年前    · 
爱跑步的冰棍  ·  python-try-except:pass ...·  1 年前    · 
不羁的南瓜  ·  原来 GitHub ...·  1 年前    · 
含蓄的人字拖  ·  vue ...·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I am using Docker desktop for Windows - community edition, version 2.4.0.0 (2020-09-28) follow tutorial https://www.youtube.com/watch?v=XrFeRwJjWHI ,

File docker-compose.yml

version: "6.0.8"
services:
  redis:
    image: redis
    volumes:
      - ./data:/data
    ports:
      - 6379:6379

I run command

Microsoft Windows [Version 10.0.19041.508]
(c) 2020 Microsoft Corporation. All rights reserved.
D:\docker>docker-compose up
ERROR: Version "6.0.8" in ".\docker-compose.yml" is invalid.
D:\docker>

but error

I see at here https://hub.docker.com/_/redis has version 6.0.8 . How to fix it?

Version tag is used for specifying docker-compose reference version. You need to choose between existing versions. See https://docs.docker.com/compose/compose-file/

If you want to set redis version you need to use image tag

version: "3.8"
services:
  redis:
    image: redis:6.0.8
    volumes:
      - ./data:/data
    ports:
      - 6379:6379
        

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.