I today deployed an instance of MediaWiki using the appcontainers/mediawiki docker image, and I now have a new problem for which I cannot find any clue. After trying to atta
This could also be the case if you have created a systemd
service that has:
[Service]
Restart=always
ExecStart=/usr/bin/docker container start -a my_container
ExecStop=/usr/bin/docker container stop -t 2 my_container
tl;dr It is restarting with a status code of 127
, meaning there is a missing file/library in your container. Starting a fresh container just might fix it.
Explanation:
As far as my understanding of Docker goes, this is what is happening:
127
, which is explained in this answer. no
(the default), (using either the command line flag --restart
or the docker-compose.yml
key restart
) while starting the container.Solution: Something might have corrupted your container. Starting a fresh container should ideally do the job.
In my case i removed
Restart=always
added
tty: true
And executed the below command to open shell (daemon process, because docker reads the compose file and stops the container once it reaches the last line of the file).
docker-compose up -d
Try adding these params to your docker yml file
restart: "no"
restart: always
restart: on-failure
restart: unless-stopped
environment:
POSTGRES_DB: "db_name"
POSTGRES_HOST_AUTH_METHOD: "trust"
Final file should look something like this
postgres:
restart: "no"
restart: always
restart: on-failure
restart: unless-stopped
image: postgres:latest
volumes:
- /data/postgresql:/var/lib/postgresql
ports:
- "5432:5432"
environment:
POSTGRES_DB: "db_name"
POSTGRES_HOST_AUTH_METHOD: "trust"
I had forgot Minikube running in background and thats what always restarted them back up