Skip to content

Latest commit

 

History

History
53 lines (34 loc) · 1009 Bytes

container_image.md

File metadata and controls

53 lines (34 loc) · 1009 Bytes

Goss container image

Dockerfiles

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

docker run --name goss ghcr.io/goss-org/goss goss

Create your container and mount goss

docker run --rm -it --volumes-from goss --name weby nginx

Run goss inside your container

docker exec weby /goss/goss autoadd nginx

HEALTHCHECK example

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

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