Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker compose error : build contains unsupported option: 'shm_size'

I'm trying to use the shm_size option when building a docker image using docker compose. My docker-compose.yml looks like this:

version: '3'
services:
  db:
    build:
      context: 'db'
      shm_size: '6gb'

When I run this I see the error:

services.db.build contains unsupported option: 'shm_size'

Does anyone know why this isn't supported?

Running docker app on MacOS with these versions:

Engine: 18.03.1-ce Compose: 1.21.1 Machine: 0.14.0

like image 912
robd Avatar asked Jul 25 '18 10:07

robd


1 Answers

The shm_size option was added in 3.5 - https://docs.docker.com/compose/compose-file/#shm_size

Therefore the fix here was to specify the minor version for the compose file of at least 3.5:

version: '3.5'
services:
  db:
    build:
      context: 'db'
      shm_size: '6gb'
like image 154
robd Avatar answered Oct 02 '22 10:10

robd