Public | Automated Build

Last pushed: 10 months ago
Short Description
Short description is empty for this repo.
Full Description

docker-base-image

A docker image that can (and probably should) be used by all containers that will run microservices for To-Increase.

Using the base image

Just base your image on this one:

FROM toincrease/docker-base-image:latest

Then use it like you normally would.

Different versions.

There are two versions: one 'nodejs' branch for nodejs services and the default which is more generic. The latter uses envconsul to inject env vars.

Running the container

This image uses a predefined entrypoint that will execute CMD arguments you provide. So, in order to execute ls with two additional arguments, you can provide a CMD target like this:

CMD ["/bin/ls", "-l", "-h" ]

Adding packages

You can add packages. Don't forget to clean the cache though. An example to add wget:

RUN apk update \
  && apk add wget \
  && rm -rf /var/cache/apk/*

Optional: Health checks.

You can define a health check for your service. If the health check detects a failure, the whole container will be killed. A check can be configured in the following way:

ADD health-check /bin/health-check

The health check itself is just a simple script. An example:

$ cat /bin/health-check
#!/bin/sh
# On a server error code, curl exits with an error code of 22
curl --silent --fail http://localhost:8080/health

Optionally, you can define the interval for the check as well by overriding the settings.profile

ADD settings.profile /etc/settings.profile

The contents of the settings.profile:

$ cat /bin/settings.profile                                                                                                                                                                                     1
# Health check interval in seconds
HEALTH_CHECK_INTERVAL=30

Links

Image location

The image is available at quay.io/toincrease/docker-base-image

Source

The source code can be found at bitbucket

Docker Pull Command
Owner
toincrease
Source Repository