From eb109d93f7480d57c9b19e66b70168aec62ee47f Mon Sep 17 00:00:00 2001 From: dklimpel <5740567+dklimpel@users.noreply.github.com> Date: Mon, 24 Jun 2024 13:59:15 +0200 Subject: [PATCH] add docs --- README.md | 4 ++++ docs/.pages | 1 + docs/container_image.md | 53 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 docs/container_image.md diff --git a/README.md b/README.md index 02ede20cb..c1788885c 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,10 @@ make build [Full Documentation](https://github.com/goss-org/goss/blob/e73553f9c3065ac297499dafb4f8abef6acb24ad/docs/manual.md) +## Using the container image + +[Using the Goss container image](docs/container_image.md) + ## Quick start diff --git a/docs/.pages b/docs/.pages index 67373453b..bed10fe4c 100644 --- a/docs/.pages +++ b/docs/.pages @@ -2,6 +2,7 @@ nav: - Home: index.md - installation.md - quickstart.md + - container_image.md - Command Reference: cli.md - The gossfile: gossfile.md - migrations.md diff --git a/docs/container_image.md b/docs/container_image.md new file mode 100644 index 000000000..ba12d30f7 --- /dev/null +++ b/docs/container_image.md @@ -0,0 +1,53 @@ +# Goss container image + +## Dockerfiles + +* [latest](https://github.com/goss-org/goss/blob/master/Dockerfile) + +## Using the base image + +This is a simple alpine image with Goss preinstalled on it. +Can be used as a base image for your projects to allow for easy health checking. + +### Mount example + +Create the container + +```sh +docker run --name goss ghcr.io/goss-org/goss goss +``` + +Create your container and mount goss + +```sh +docker run --rm -it --volumes-from goss --name weby nginx +``` + +Run goss inside your container + +```sh +docker exec weby /goss/goss autoadd nginx +``` + +### HEALTHCHECK example + +```dockerfile +FROM ghcr.io/goss-org/goss:latest + +COPY goss/ /goss/ +HEALTHCHECK --interval=1s --timeout=6s CMD goss -g /goss/goss.yaml validate + +# your stuff.. +``` + +### Startup delay example + +```dockerfile +FROM ghcr.io/goss-org/goss:latest + +COPY goss/ /goss/ + +# Alternatively, the -r option can be set +# using the GOSS_RETRY_TIMEOUT env variable +CMD goss -g /goss/goss.yaml validate -r 5m && exec real_comand.. +```