Output Blocks#

The output_blocks setting can be used to inject commands directly into the Dockerfile generated by the OU Container Builder.

Warning

This is the equivalent of a nuclear-powered chainsaw. Beware. Any mistakes in the custom output blocks are likely to prevent the VCE from building or running.

output_blocks:
  build:
    - block:    # The block text to write into the Dockerfile
      weight:   # Weight used for ordering the output blocks
  deploy:
    - block:
      weight:

All blocks are sorted using the weight and then the block text is written as-is to the Dockerfile. The Output Block Weights lists weight values and what activities are allocated to which weight ranges. Blocks defined in the Configuration.yaml should use weights from ranges that are marked as “Free”, to ensure stable and repeatable behaviour.

Common Recipies#

Here are a set of common recipies for which the output_blocks need to be used.

Copying data into the build stage#

To copy data into the build stage, for use in build scripts, adapt the following snippet:

output_blocks:
  build:
    - block: COPY source.tar.gz /target/location.tar.gz
      weight: 201

This ensures that the file is copied before any scripts are run and is available to those scripts.

Copying data from build to deploy stage#

If building software in the build stage, to copy data into the final deploy VCE image, adapt the following snippet:

output_blocks:
  deploy:
    - block: COPY --from=base /path/to/build/output /target/location
      weight: 2001