Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): Add runtime-base image #2919

Merged
merged 4 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/build-runtime-base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build base Docker image
on:
workflow_dispatch:
inputs:
repo_ref:
description: "git reference of the zksync-era to build"
required: true
default: main
jobs:
build-images:
name: Build and Push Docker Images
runs-on: matterlabs-ci-runner-high-performance
outputs:
image_tag_sha: ${{ steps.get-sha.outputs.image_tag_sha }}
# Needed to push to Gihub Package Registry
permissions:
packages: write
contents: read
env:
REPO_REF: ${{ github.event.inputs.repo_ref }}
strategy:
matrix:
name: [ runtime-base ]
image_name: [ zksync-runtime-base ]

steps:
- uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc # v4.1.7
with:
submodules: "recursive"

- name: Login to google container registry
run: |
gcloud auth configure-docker us-docker.pkg.dev -q

- name: Login to GitHub Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Get tag
id: get-sha
run: |
echo IMAGE_TAG_SHA=$(git rev-parse --short HEAD) >> $GITHUB_ENV
echo image_tag_sha=$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1

- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0

- name: Build and push
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
push: true
context: .
platforms: |
- linux/arm64
- linux/amd64
file: docker/${{ matrix.name }}/Dockerfile
labels: |
org.opencontainers.image.source=https://github.com/matter-labs/zksync-era
org.opencontainers.image.licenses="MIT OR Apache-2.0"
tags: |
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.image_name }}:latest
ghcr.io/${{ github.repository_owner }}/${{ matrix.image_name }}:latest
9 changes: 9 additions & 0 deletions docker/runtime-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM debian:bookworm-slim

RUN apt-get update && \
apt-get install -y \
curl \
libpq5 \
ca-certificates \
&& \
rm -rf /var/lib/apt/lists/*
Loading