Skip to content

Make Docker Container Keep on Running

It's great for custom docker build, where you might wanna do some testing first.

Dockerfile

Docker
# U can use whatever image
FROM alpine

RUN apk add nano

COPY docker-entrypoint.sh /

RUN ["chmod", "+x", "/docker-entrypoint.sh"]

CMD ["sh","-c","/docker-entrypoint.sh" ]

docker-entrypoint.sh

Bash
#!/bin/bash


# Run if there is nothing to do :)
while true; do sleep 9999; done
Back to top