- Viewed 512k times347answered Oct 17, 2016 at 18:35
Containers are meant to run to completion. You need to provide your container with a task that will never finish. Something like this should work:
apiVersion: v1kind: Podmetadata:name: ubuntuspec:containers:- name: ubuntuimage: ubuntu:latest# Just spin & wait forevercommand: [ "/bin/bash", "-c", "--" ]args: [ "while true; do sleep 30; done;" ]Content Under CC-BY-SA license How can I keep a container running on Kubernetes?
What does the Docker sleep command do? - Stack Overflow
- People also ask
Airbnb Review: What Sleeping in a Shipping Container Home is …
How to Keep Docker Container Running - DevOps Blog
WEBDec 20, 2023 · #1 Using the sleep infinity command. A straightforward method to prevent a Docker container from exiting is to use the sleep infinity command. The sleep command is designed to pause command …
Running Docker Containers Indefinitely | Baeldung on Ops
Keeping Docker Containers Running – A Guide for Developers
linux - How to sleep a pod in Kubernetes - Server Fault
Keep Container Running On Kubernetes - Shaun Yuan
WEBJan 12, 2023 · 1. Sleep Command. 2. Infinite Loop. 3. Sleep in Dockerfile. In order to keep a POD running it should to be performing certain task, otherwise Kubernetes will find it unnecessary, therefore it stops. There …
How to Keep Docker Container Running for Debugging
WEBApr 26, 2024 · Method 1: Interactive Shell Session with pseudo-tty. You can use the -t (pseudo-tty) docker parameter to keep the container running. Replace tty-container with required name and ubuntu with required …
6 Best Ways to Keep Docker Container Running For Debugging