How to set --shm-size 128m on railway Postgres database docker

There's a issue on github telling more about it https://github.com/docker-library/postgres/issues/416
GitHub
Hit by size limit of /dev/shm · Issue #416 · docker-library/postgres
The default limit for Docker containers seems to be 64MB ERROR: could not resize shared memory segment "/PostgreSQL.2088012784" to 50438144 bytes: No space left on device I couldn't r...
Solution:
for the record, you can not set flags intended for the docker run command.
Jump to solution
17 Replies
Percy
Percy4mo ago
Project ID: eb397f3a-ebde-411c-ad58-d744a699bed0
Gabriel Jatobá
Gabriel Jatobá4mo ago
eb397f3a-ebde-411c-ad58-d744a699bed0 Seems that a custom start command doesn't work bc it needs to go on image
Michaelvips
Michaelvips4mo ago
you mean set a size limit ?
Gabriel Jatobá
Gabriel Jatobá4mo ago
It's a size limit for shared memory in postgres
Michaelvips
Michaelvips4mo ago
I think you don´t need set this on railway.
Gabriel Jatobá
Gabriel Jatobá4mo ago
An example of how to run: docker run -it --rm --shm-size 128m alpine:3.7 df -hT /dev/shm @Michaelvips Actually I need, bc I'm having the error in the railway database. Because it's not the machine memory but shared memory on docker.
Michaelvips
Michaelvips4mo ago
you already using 100% of your account plan resources?
Gabriel Jatobá
Gabriel Jatobá4mo ago
No. Like I said it's not a resource problem, but a docker managment resource problem. Look
No description
Gabriel Jatobá
Gabriel Jatobá4mo ago
I have the hobby plan with 8gb ram, and i'm not using 4gb ram at all
Michaelvips
Michaelvips4mo ago
try to remove the comand that is seting the size of memory, I think railway do not support this.
Gabriel Jatobá
Gabriel Jatobá4mo ago
Exactly, I want to set it on the docker image that railways provides but seems like I can't.
Michaelvips
Michaelvips4mo ago
you can´t use railway like a standard vps, some functions you can´t access
Gabriel Jatobá
Gabriel Jatobá4mo ago
I know, but as it provides a good docker support, I thought that they can adjust this in some way?
Michaelvips
Michaelvips4mo ago
you need create a empy service an then use the image docker not a database with image to data base the only image docker you need use is from postgres
Michaelvips
Michaelvips4mo ago
No description
Medim
Medim4mo ago
@Gabriel Jatobá are you brazilian? if so, do you mind upvoting this community suggestion ? Bora trazer o Railway pro Brasil 😉
Solution
Brody
Brody4mo ago
for the record, you can not set flags intended for the docker run command.