diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 72077febdad8a0f716344b8c53696d8b4074be4d..8586f61577ee765c2d768a351156f3e77ab20269 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -100,3 +100,19 @@ push-crond: needs: - job: build-crond artifacts: true + +# sleep image: + +build-sleep: + extends: .container-build + variables: + CONTEXT: sleep + +push-sleep: + extends: .container-push + variables: + CONTEXT: sleep + IMAGE: cron + needs: + - job: build-sleep + artifacts: true diff --git a/sleep/.dockerignore b/sleep/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..91445b94f5921ddc8269189c6eda60e8ddd65531 --- /dev/null +++ b/sleep/.dockerignore @@ -0,0 +1,2 @@ +* +!entrypoint diff --git a/sleep/Dockerfile b/sleep/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..712bef6d2c7e3b5cf5b057a7cccc71d86dc32bd0 --- /dev/null +++ b/sleep/Dockerfile @@ -0,0 +1,6 @@ +FROM alpine:3.14 +COPY --chown=root:root entrypoint /usr/local/bin/entrypoint +USER nobody +ENTRYPOINT ["entrypoint"] +CMD ["sleep", "10"] +HEALTHCHECK CMD true diff --git a/sleep/README.md b/sleep/README.md new file mode 100644 index 0000000000000000000000000000000000000000..cb0d9800c156c497a6a4af24d164486af83703b0 --- /dev/null +++ b/sleep/README.md @@ -0,0 +1,18 @@ +# Sleep container image + +A container image that just sleeps 10 on repeat (will output the sleep command +so you know it's running). + +## Usage + +For interactive use, specify `-it` so you ctrl+c the container: + +``` +docker run -it --name sleep registry.shore.co.il/sleep +``` + +You can also specify a more complex command: + +``` +docker run -it --name sleep registry.shore.co.il/sleep date '&&' sleep 5 +``` diff --git a/sleep/entrypoint b/sleep/entrypoint new file mode 100755 index 0000000000000000000000000000000000000000..5684de357beba4cd5fb8afa1ca31e8fdee9dd730 --- /dev/null +++ b/sleep/entrypoint @@ -0,0 +1,7 @@ +#!/bin/sh + +while true +do + echo "$@" + eval "$@" +done