如何查看docker-compose.yml所在位置
查看docker-compose.yml所在位置
前提要開(kāi)啟docker
locate docker-compose.yml
docker-compose.yml報(bào)錯(cuò)
ERROR: The Compose file './docker-compose.yml' is invalid because:
Invalid top-level property "True". Valid top-level sections for this Compose file are: version, services, networks, volumes, secrets, configs, and extensions starting with "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/
解決方案
全選復(fù)制的時(shí)候粘貼yml文件的時(shí)候可能存在丟字段的問(wèn)題,我的是把頂部的版本丟了
可以分段復(fù)制粘貼。我是這樣解決的
總結(jié)
以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
相關(guān)文章
使用 VPS 下載 Docker 鏡像并導(dǎo)入到本地服務(wù)器的過(guò)程
這篇文章主要介紹了使用 VPS 下載 Docker 鏡像并導(dǎo)入到本地服務(wù)器,通過(guò)使用 VPS 下載 Docker 鏡像并將其傳輸?shù)奖镜胤?wù)器,我們可以克服網(wǎng)絡(luò)限制,更靈活地管理和部署 Docker 鏡像,需要的朋友可以參考下2024-08-08docker-compose---安裝掛載本地文件啟動(dòng)mariadb問(wèn)題
這篇文章主要介紹了docker-compose---安裝掛載本地文件啟動(dòng)mariadb問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-03-03Docker一鍵部署springcloud項(xiàng)目的方法
本文主要介紹了Docker一鍵部署springcloud項(xiàng)目的方法,文中通過(guò)示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2021-12-12基于Docker如何實(shí)現(xiàn)MySQL主從復(fù)制詳解
這篇文章主要給大家介紹了關(guān)于基于Docker如何實(shí)現(xiàn)MySQL主從復(fù)制的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者使用MySQL具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2019-10-10Next.js?Docker鏡像私有部署從零實(shí)現(xiàn)
這篇文章主要為大家介紹了Next.js?Docker鏡像私有部署從零實(shí)現(xiàn),有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-12-12Linux上使用docker啟動(dòng)redis并遠(yuǎn)程訪(fǎng)問(wèn)的實(shí)現(xiàn)
這篇文章主要介紹了Linux上使用docker啟動(dòng)redis并遠(yuǎn)程訪(fǎng)問(wèn)的實(shí)現(xiàn)方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-04-04