Docker撰写文件无效

时间:2019-03-28 21:34:23

标签: docker docker-compose

我正在尝试在运行时为我的两个图像创建运行状况检查,但是当我设置第一个图像时,我得到了:

  

错误:撰写文件'./docker-compose.yml'无效,因为:   docker-bench-security的不受支持的配置选项:'healthcheck'

下面是我的图片

$ docker build --rm -t docker-bench-security .

这是我的 docker-compose.yml

    version: '3.1'

services:

  wordpress:
    image: wordpress
    restart: always
    ports:
      - 8080:80
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_USER: exampleuser
      WORDPRESS_DB_PASSWORD: examplepass
      WORDPRESS_DB_NAME: exampledb

  db:
    image: mysql:5.7
    restart: always
    environment:
      MYSQL_DATABASE: exampledb
      MYSQL_USER: exampleuser
      MYSQL_PASSWORD: examplepass
      MYSQL_RANDOM_ROOT_PASSWORD: '1'
  healthcheck:
   test: ["CMD", "ec2-user_db_1"]

来自docker ps -a的信息

Image:       Command:                            Name: 
mysql:5.7    "docker-entrypoint.sh mysqld"       ec2-user_db_1
wordpress    "docker-entrypoint.sh apache2-foreground"   ec2-   user_wordpress_1

任何帮助将不胜感激!

0 个答案:

没有答案