在文件'./docker-compose.yml'中,服务'image'必须是映射而不是字符串

在文件'./docker-compose.yml'中,服务'image'必须是映射而不是字符串
wordpress:
  image: wordpress
  links:
    - wordpress_db:mysql
  ports:
    - 8080:80
wordpress_db:
  image: mariadb
  environment:
    MYSQL_ROOT_PASSWORD: edureka
phpmyadmin:
  image: corbinu/docker-phpmyadmin
  links:
    - wordpress_db:mysql
  ports:
    - 8181:80
  environment:
    MYSQL_USERNAME: root
    MYSQL_ROOT_PASSWORD: edureka

答案1

最小 docker-compose.yaml 文件:

version: "3.9"
services:
  web:
    image: nginx:alpine
    ports:
     - 80:80

运行:docker compose up

在后台运行:docker compose up -d

对于停止和删除:docker compose down

相关内容