eRROR:撰写文件'./docker-compose.yml'无效,因为

问题描述 投票:0回答:0

他说错了 这是一个:

https://github.com/navilg/media-stack

我的错误消息是:

root@ubuntu:~/docker-compose/media-stack# docker-compose --profile stack-2 up -d ERROR: The Compose file './docker-compose.yml' is invalid because: 'name' does not match any of the regexes: '^x-' You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1. For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/

我的版本是: root@ubuntu:~/docker-compose/media-stack# docker version Customer: Version: 20.10.16 API version: 1.41 Go version: go1.18.1 Git commit: 20.10.16-0ubuntu1 Built: Thu May 12 20:45:12 2022 OS/Arch: linux/arm64 Context: default Experimental: true server: Engine: Version: 20.10.16 API version: 1.41 (minimum version 1.12) Go version: go1.18.1 Git commit: 20.10.16-0ubuntu1 Built: Thu May 12 20:04:31 2022 OS/Arch: linux/arm64 Experimental: false containerd: Version: 1.6.4-0ubuntu1.1 GitCommit: runc: Version: 1.1.2-0ubuntu1.1 GitCommit: docker-init: Version: 0.19.0 GitCommit: root@ubuntu:~/docker-compose/media-stack# docker-compose version docker-compose version 1.29.2, build unknown docker-py version: 5.0.3 CPython version: 3.10.7 OpenSSL version: OpenSSL 3.0.5 5 Jul 2022

我试图将Docker-Compose上的版本更改为版本1或2和3,但没有任何可起作用。 docker-compose是:

version: "3.9" name: media-stack services: vpn: ## Read https://github.com/qdm12/gluetun/wiki for details on configuring VPN for different service providers. profiles: ["vpn", "stack-2"] container_name: vpn image: qmcgaw/gluetun:v3.32 cap_add: - NET_ADMIN environment: - VPN_SERVICE_PROVIDER=${VPN_SERVICE_PROVIDER:-nordvpn} # Valid values: nordvpn, expressvpn, protonvpn, surfshark or custom - OPENVPN_USER=${OPENVPN_USER:-""} - OPENVPN_PASSWORD=${OPENVPN_PASSWORD:-""} ## For list of server regions and countries, visit https://raw.githubusercontent.com/qdm12/gluetun/master/internal/storage/servers.json ## SERVER_REGIONS is required for NordVPN and Surfshark VPN. Comment SERVER_COUNTRIES if SERVER_REGIONS is used. - SERVER_REGIONS=${SERVER_REGIONS:-Switzerland} ## SERVER_COUNTRIES is required for ExpressVPN and ProtonVPN. Comment SERVER_REGIONS if SERVER_COUNTRIES is used. # - SERVER_COUNTRIES=${SERVER_COUNTRIES:-Netherlands} # - FREE_ONLY=on # Valid with protonvpn only. on if using free service provided by protonvpn ## Enable below if VPN_SERVICE_PROVIDER=custom # - VPN_TYPE=openvpn # or wireguard. ## If VPN_TYPE is openvpn # - OPENVPN_CUSTOM_CONFIG=/gluetun/custom.conf ## If VPN_TYPE is wireguard. Replace below env variables as required. # - VPN_ENDPOINT_IP=1.2.3.4 # Replace with your wg endpoint ip or domain # - VPN_ENDPOINT_PORT=51820 # Replace with wg server port # - WIREGUARD_PUBLIC_KEY=wAUaJMhAq3NFutLHIdF8AN0B5WG8RndfQKLPTEDHal0= # Replace with your wg public key # - WIREGUARD_PRIVATE_KEY=wOEI9rqqbDwnN8/Bpp22sVz48T71vJ4fYmFWujulwUU= # Replace with your wg client private key # - WIREGUARD_PRESHARED_KEY=xOEI9rqqbDwnN8/Bpp22sVz48T71vJ4fYmFWujulwUU= # Replaced with your wg pre-shared key # - WIREGUARD_ADDRESSES="10.64.222.21/32" # Replace with wg address ## Enable volume if custom VPN_SERVICE_PROVIDER is used # volumes: # - /yourpath/yourconfig.conf:/gluetun/config.conf:ro networks: - mynetwork ports: # qbittorrent ports - 5080:5080 - 6881:6881 - 6881:6881/udp # prowlarr ports - 9696:9696 # Transmission ports. Uncomment below if Transmission is used with VPN # - 9091:9091 # - 51413:51413 # - 51413:51413/udp restart: "unless-stopped" transmission: profiles: ["tx", "stack-1"] container_name: transmission image: lscr.io/linuxserver/transmission:3.00-r6 networks: - mynetwork # network_mode: service:vpn # Uncomment this line if vpn is enabled environment: - PUID=1000 - PGID=1000 - TZ=UTC - USER=admin - PASS=nimdatx ## Comment below ports if VPN is enabled. ports: - 9091:9091 - 51413:51413 - 51413:51413/udp volumes: - tx-config:/config - torrent-downloads:/downloads - tx-watch:/watch restart: "unless-stopped" ## Default credentials - Username: admin password: adminadmin ## ## Change password after install from UI --> Tools --> Options --> WebUI ## qbittorrent: container_name: qbittorrent profiles: ["qbt", "stack-2"] image: lscr.io/linuxserver/qbittorrent:4.5.0 # Comment this if vpn is disabled depends_on: - vpn networks: - mynetwork network_mode: service:vpn # Comment this line if vpn is disabled environment: - PUID=1000 - PGID=1000 - TZ=UTC - WEBUI_PORT=5080 volumes: - qbittorrent-config:/config - torrent-downloads:/downloads ## Uncomment below ports if VPN is disabled. # ports: # - 5080:5080 # - 6881:6881 # - 6881:6881/udp restart: "unless-stopped" radarr: profiles: ["base", "radarr", "stack-1", "stack-2"] container_name: radarr image: lscr.io/linuxserver/radarr:4.2.4 networks: - mynetwork environment: - PUID=1000 - PGID=1000 - TZ=UTC ports: - 7878:7878 volumes: - radarr-config:/config - torrent-downloads:/downloads restart: "unless-stopped" sonarr: profiles: ["base", "sonarr", "stack-1", "stack-2"] image: lscr.io/linuxserver/sonarr:develop-version-4.0.0.269 container_name: sonarr networks: - mynetwork environment: - PUID=1000 - PGID=1000 - TZ=UTC volumes: - sonarr-config:/config - torrent-downloads:/downloads ports: - 8989:8989 restart: unless-stopped jackett: profiles: ["jackett", "stack-1"] container_name: jackett image: lscr.io/linuxserver/jackett:v0.20.2309 networks: - mynetwork environment: - PUID=1000 - PGID=1000 - TZ=UTC volumes: - jackett-config:/config - jackett-blackhole:/downloads ports: - 9117:9117 restart: unless-stopped prowlarr: profiles: ["prowlarr", "stack-2"] container_name: prowlarr image: linuxserver/prowlarr:0.4.9-develop # Comment this if vpn is disabled depends_on: - vpn network_mode: service:vpn # Comment this line if vpn is disabled networks: - mynetwork environment: - PUID=1000 - PGID=1000 - TZ=UTC volumes: - prowlarr-config:/config ## Uncomment below ports if VPN is disabled. # ports: # - 9696:9696 restart: unless-stopped jellyfin: profiles: ["base", "jelly", "stack-1", "stack-2"] image: lscr.io/linuxserver/jellyfin:10.8.8 container_name: jellyfin networks: - mynetwork environment: - PUID=1000 - PGID=1000 - TZ=UTC volumes: - jellyfin-config:/config - torrent-downloads:/data # devices: # - /dev/videoN:/dev/videoN # Mount GPU device ports: - 8096:8096 - 7359:7359/udp - 8920:8920 restart: unless-stopped volumes: torrent-downloads: radarr-config: sonarr-config: jackett-config: jackett-blackhole: prowlarr-config: jellyfin-config: qbittorrent-config: tx-config: tx-watch: networks: mynetwork: external: true
你曾经看过这个问题吗?

感谢您的关注。
	
您正在运行非常古老的Docker和Docker撰写版本,同时尝试使用Compose Spec的较新功能。您要么需要升级安装(Compose 2.34.0是当前版本),要么从撰写文件中删除这些功能(删除

name

行)。

docker docker-compose yaml
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.