Docker mount shm(shared memory) with custom size script.
#!/bin/bash##USAGE
##Для изменения размера разделяемой памяти в докер контейнере необходимо указать размер в мегабайтах(M) и имя сервисаDOCKER_SERVICE_NAME="disp"
DOCKER_SHM_SIZE="512M"
DOCKER_SERVICE_NAME_ID=$(docker ps | grep ${DOCKER_SERVICE_NAME} | grep -ve 'exporter' | awk '{print $NF}')
DOCKER_ROOT_DIR=$(docker inspect ${DOCKER_SERVICE_NAME_ID} | grep 'HostnamePath' | awk '{print $2}' | tr -d \" | tr -d \, | sed -nr "s/^(.*)\/(.*)\/(.*)\/.*/\1/p")
DOCKER_CONTAINER_MOUNT_ID=$(docker inspect ${DOCKER_SERVICE_NAME_ID} | grep 'HostnamePath' | awk '{print $2}' | tr -d \" | tr -d \, | sed -nr "s/^(.*)\/(.*)\/(.*)\/.*/\3/p")
sudo mount -o remount,size=${DOCKER_SHM_SIZE} ${DOCKER_ROOT_DIR}/containers/${DOCKER_CONTAINER_MOUNT_ID}/mounts/shm