Code Monkey home page Code Monkey logo

goss-docker's Introduction

Goss Docker container

Dockerfiles

Goss

Not sure what Goss is, read these:

  • Goss - Project page
  • Blog post - Examples on how these Goss images can be used

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 aelsabbahy/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 aelsabbahy/goss:latest

COPY goss/ /goss/
HEALTHCHECK --interval=1s --timeout=6s CMD goss -g /goss/goss.yaml validate

# your stuff..

Startup delay example

FROM aelsabbahy/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..

Using the onbuild image

Create a goss/goss.yaml file and optionally a checks folder in the following structure:

.
|-- Dockerfile
`-- goss/
    |-- checks/
    |   `-- db_login.sh
    `-- goss.yaml

In your Dockerfile use the onbuild container as follows:

Serve a healthz endpoint

FROM aelsabbahy/goss:onbuild
CMD ["serve"]

Run tests until they pass or we timeout

FROM aelsabbahy/goss:onbuild
CMD ["validate", "--retry-timeout", "5m", "--sleep", "10s"]

goss-docker's People

Contributors

aelsabbahy avatar asa1-et-jenkins avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.