I am trying to implement docker container based CI runner for building embedded software on git actions platform which pulls docker image from docker hub and performs the action in it.
However, runner can't retain the pulled docker image in subsequent trigger events, I tried to look up how to use caching feature to cache pulled image and use it run the job but, it doesn't seem to work correctly.
There are multiple forums which discuss how to cache docker layer (build layer) and cache is using actions but, no guide on how to cache the pulled container without building it on github actions.
Question is : How to cache a pulled docker image rather than building one from cached docker layers ? Any help will be helpful. Thanks in advance.
name: push workflows
# on Event push trigger action specified in jobs
on: [push]
jobs:
Build-Job:
# base OS
runs-on: ubuntu-latest
# run in docker container
container:
image: {myrepo}/{image}:{version}
steps:
# Checkout repo
- name: Checkout repo
uses: actions/checkout@v2
# mount project to /home/git and build
- name: Build in Docker
run: |
echo Hello from docker
sudo ln -s $(pwd) /home/git
cd /home/git/project
chmod u+x docker_build.sh
./docker_build.sh
# Upload artifacts if build was successful
- name: Upload Artifacts
uses: actions/upload-artifact@v2.2.0
with:
name: output_files
path: /home/git/project/output_files/**
if-no-files-found: error
retention-days: 90