Skip to content

Speed up workflows with Docker images #95

@redeboer

Description

@redeboer

APT installs are time consuming, see for instance this log. It can be sped up by creating a Docker container on hub.docker.com/orgs/compwa and pulling it in the workflow with container.image.


Example for that specific log (2m48s).

  1. Create a Dockerfile:

    FROM python:3.8
    RUN apt-get -y update
    
    # https://serverfault.com/a/992421
    RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
    RUN apt-get -y install inkscape latexmk make texlive-fonts-extra texlive-xetex xindy
    
    RUN apt-get autoclean -y
    RUN apt-get autoremove -y
    RUN rm -rf /var/lib/apt/lists/*
  2. Build the image and push to Docker Hub:

    REPO=polarimetry
    JOB=fast-pdf
    docker build -t compwa/$REPO-$JOB .
    docker push compwa/$REPO-$JOB

This workflow was sped up by two minutes, see this log (57s container initialisation).

Metadata

Metadata

Assignees

No one assigned

    Labels

    🖱️ DXImprovements to the Developer Experience

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions