Copilot
Your everyday AI companion
About 3,060,000 results
Open links in new tab
    Upvotes347answered 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: v1
    kind: Pod
    metadata:
    name: ubuntu
    spec:
    containers:
    - name: ubuntu
    image: ubuntu:latest
    # Just spin & wait forever
    command: [ "/bin/bash", "-c", "--" ]
    args: [ "while true; do sleep 30; done;" ]
    Content Under CC-BY-SA license
    Was this helpful?
     
  1. How can I keep a container running on Kubernetes?

     
  2. What does the Docker sleep command do? - Stack Overflow

  3. People also ask
  4. Airbnb Review: What Sleeping in a Shipping Container Home is …

  5. 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 …

  6. Running Docker Containers Indefinitely | Baeldung on Ops

  7. Keeping Docker Containers Running – A Guide for Developers

  8. linux - How to sleep a pod in Kubernetes - Server Fault

  9. 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 …

  10. 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 …

  11. 6 Best Ways to Keep Docker Container Running For Debugging