Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to start docker Container from docker-compose - "unknown flag: --iidfile"

When I try to run ' docker-compose up" the command prompt throws the below error :

$ docker-compose up
Building tomcat
unknown flag: --iidfile
See 'docker build --help'.
ERROR: Service 'tomcat' failed to build

Below is the Dockerfile and docker-compose.yml file:

$ cat Dockerfile.dev
FROM node:alpine

WORKDIR '/app'

COPY package.json .
RUN npm install
COPY . .

CMD ["npm", "run", "start"] `

$ cat docker-compose.yml
version: '3'
services:
  tomcat:
    restart: always
    build:
      context: .
      dockerfile: Dockerfile.dev
    ports:
      - "3000:3000"
    volumes:
      - /app/node_modules
      - .:/app
  tests:
    restart: always
    build:
      context: .
      dockerfile: Dockerfile.dev
    volumes:
      - /app/node_modules
      - .:/app
    command: ["npm", "run", "test"]

Do I have something wrong configuration in Dockerfile or docker-compose.yml?

like image 475
JOY_M Avatar asked Apr 08 '21 19:04

JOY_M


1 Answers

I faced the same problem when using docker-compose 1.29.1. Downgrading to docker-compose 1.26.2 resolved this problem.

reinstall docker-compose 1.26.2

rm -f /usr/local/bin/docker-compose
curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose
like image 67
user z Avatar answered Sep 20 '22 20:09

user z