Skip to content

Add a new Service

Christoph Diehl edited this page Oct 28, 2019 · 4 revisions

Add a new Service

A service.yaml file is from now on required and must be placed within your service root directory. The purpose of the file is to define for which architecture you want to build your service, provide build arguments to the build process and how your service shall be named. If you are not ready for multi-arch images and or you prefer to build only for AMD64 or do not make use of any build arguments you can define an empty service.yaml which only sets the name of the image.

Example

service.yaml
name: mynewservice

A more detailed example from FuzzOS

name: fuzzos
arch:
  amd64:
    build_args:
      - IMAGE=mozillasecurity/core:amd64-latest
  arm64:
    build_args:
      - IMAGE=mozillasecurity/core:arm64-latest
manifest: ./scripts/docker-manifest.sh mozillasecurity fuzzos

Here we are building for AMD64 and ARM64 and use for each new image a custom base or parent image. At the end we combine those two images as a multi-arch image by using a manifest and each image will be available for each architecture under the same name.

Add to Travis

In order to let TravisCI build an image from your Dockerfile you must run the following steps:

  1. Create a directory mynewservice with the Dockerfile and optional recipes - preferably in a sub-folder named recipes.
  2. Recommended: Build the image locally and verify it passes the linting tests of your recipes, Dockerfile and passes the container tests which you provided for your container.
  3. Add your new service to the env.matrix in the .travis.yml
env:
  global:
    - DOCKER_ORG=mozillasecurity
    [...]
  matrix:
    - IMAGE=services/linter
    - IMAGE=services/mynewservice  <---
  1. Push to GitHub
  2. Check the build status. If it successfully passed you can download your image via docker pull mozillasecurity/mynewservice.
Clone this wiki locally