Starting stopped docker container

Today we faced with a scenario where we started Kong API gateway and tried to access previously created APIs and keys. They were gone, they do not exist. Thats where we got panicked.

How we solved it?

First get stopped docker containers

docker ps -a

This will list all stopped containers. Then starting the previously used container we want. (postgresql and kong)

docker container start

References

Best practice for long running docker containers

As we normally use docker run image-name , this may get into problems when its used in a production server. When node is restarted we will have to manually start these containers.

docker run -d --restart unless-stopped redis 

This command will automatically start any stopped docker containers crashed during node restart. There are more valueble commands available here in official document.

Also its very important to add docker service to start in bootup.

systemctl enable docker

In this very short guide, I explained an issue we faced. Hope this will help someone to overcome this simple docker based issue.

--

--

--

DevOps who is willing to learn and try new things.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Constellation Update — Scalable Protocol Alliance Launch, Ambassador News, Engineering Updates…

Indicator Building In Superalgos: The Ultimate Guide to Tame the UI

Why Do You Need An Accountability Partner?

Ohno — save food save world

The essential guide on being an effective Discord Modulator

3 Tips for Limiting Your Work-in-Progress

今週の野鳥写真

Latest trends in Business Analysis

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sachith Muhandiram

Sachith Muhandiram

DevOps who is willing to learn and try new things.

More from Medium

Version Control using Git and Github (Part 1)

Ansible basics- Use of meta:end_play

Docker

Solving Jenkins “stderr=Host key verification failed” problem when all else fails

Deployment flow (Github -> Jenkins -> Remote -> AWS ECR)