服务'wp'取决于未定义的服务'wpdb:mysql'

时间:2017-12-31 20:10:12

标签: docker docker-compose

我尝试使用yml构建并运行以下docker-compose up -d文件,我收到以下错误:

Service 'wp' depends on service 'wpdb:mysql' which is undefined.

docker-compose.yml档案:

version: '3'
   services:
       wpdp:
           image: mariadb
           ports:
               - "8081:3306"
           environment:
               MYSQL_ROOT_PASSWORD: "root_password"
               MYSQL_DATABASE: "db_name"
               MYSQL_USER: "db_user"
               MYSQL_PASSWORD: "db_password"
      wp:
          image: wordpress
          volumes:
              - ./:/var/www/html
          ports:
              - "8080:80"
          depends_on:
              - wpdb:mysql
          links:
              - wpdb:mysql
          environment:
              WORDPRESS_DB_USER: "wp_user"
              WORDPRESS_DB_PASSWORD: "wp_password"
              WORDPRESS_DB_NAME: "db_name"

我遵循了tutorial

我搜索了很多但找不到解决方案

0 个答案:

没有答案