Skip to content

Consolidate dockerfile RUN commands to shrink container size #19

Consolidate dockerfile RUN commands to shrink container size

Consolidate dockerfile RUN commands to shrink container size #19

Workflow file for this run

name: build_test_and_push_docker
on:
push:
# branches:
# - "main"
env:
TEST_TAG: mkavulich/ccpp-scm:test
LATEST_TAG: mkavulich/ccpp-scm:latest
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and export test tag
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
load: true
tags: ${{ env.TEST_TAG }}
- name: Test
run: |
docker pull ${{ env.TEST_TAG }}
mkdir $HOME/output
chmod a+rw $HOME/output
docker run --rm -v $HOME/output:/home ${{ env.TEST_TAG }} ./run_scm.py -f ../../test/rt_test_cases.py --runtime_mult 0.1 -d
- name: Push latest tag
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.LATEST_TAG }}