salt: Salt in Docker container cannot run dmidecode

When running Salt in a Docker container, I get:

salt | [WARNING ] Although 'dmidecode' was found in path, the current user cannot execute it. Grains output might not be accurate.

When logged into the salt master running in the container, dmidecode returns the following:

[root@salt /]# dmidecode
# dmidecode 2.12-dmifs
/dev/mem: No such file or directory

The container is running CentOS 7. Dockerfile here and docker-compose.yml here.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 21 (9 by maintainers)

Most upvoted comments

For those of you/us running Salt in a Docker container, you can make dmidecode work by running your container privileged.

For example:

docker run --privileged ...

Or in docker-compose.yml:

version: "2"

services:
  master:
    privileged: true