Services

YAML keys for services block

The services key is intended to be used to run applications alongside the pipeline.

---
# This document is displaying all the required keys
# to run a postgres database for the duration of a pipeline.
services: 
  - name: postgres
    image: postgres:latest

Keys

KeyRequiredTypeDescription
nameYstringUnique identifier for the container in the pipeline
imageYstringDocker image used to create an ephemeral container
pullNstringDeclaration to configure if and when the Docker image is pulled
environmentNmap
entrypointN[]stringCommands to execute inside the container
portsNstringList of ports to map for the container in the pipeline
ulimitsN[]stringSet the user limits for the container
userNstringSet the user for the container.

Usage

The name: key

---
services: 
    # Unique identifier for the container in the pipeline.
  - name: postgres

The image: key

---
services: 
    # Docker image used to create ephemeral container.
  - image: postgres:latest

The pull: key

---
services: 
    # Declaration to configure if and when the Docker image is pulled.
    # By default, the compiler will inject pull but accepts the 
    # following values: always, never, no_present, on_start, 
  - pull: always

The environment: key

---
services: 
    # Variables to injected into the container environment
    # using a map style syntax.
  - environment:
      DB_NAME: vela
---
services: 
    # Variables to injected into the container environment
    # using an array style syntax.
  - environment:
      - DB_NAME=vela

The entrypoint: key

---
services: 
    # Commands to execute inside the container.
  - entrypoint:
      - some/path/sql-init.sql
      - /some/binary/postgres

The ports: key

---
services: 
    # List of ports to map for the container in the pipeline.
  - ports: 
      - "8080:5432"

The ulimits: key

---
services:
    # Set the user limits for the container.
  - ulimits:
      - name: foo
        soft: 1024
      - name: bar
        soft: 1024
        hard: 2048

The user: key

---
services:
    # Run the container with the foo user.
  - user: foo