How to suppress warnings in docker-compose?

Viewed 2357

In a development environment, using docker-compose with a compose file made for Docker Swarm, e.g.:

version: "3.8"
services:
  some-service:
    image: nginx
    ports:
      - "8080:80"
    configs:
      - source: some-config
        target: /etc/nginx/nginx.conf
configs:
  some-config:
    external: true

there's always a warning like:

WARNING: Some services (some-service) use the 'configs' key, which will be ignored. Compose does not support 'configs' configuration - use `docker stack deploy` to deploy to a swarm.

This main file is for production, and is combined with other compose file(s), adding bind mounts and debug configuration, but don't know how to remove the 'configs' key.

Is there a way to suppress this warning or remove the 'configs' key with a compose file override?

2 Answers

Docker-compose now has a log-level flag.

For example docker-compose --log-level ERROR run --rm .... This will suppress the warnings, but you will still see the container output.

Related