Skip to content

Commit

Permalink
feat: add pcre2-dev library to the images
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Gershman <[email protected]>
  • Loading branch information
romange committed Jan 31, 2025
1 parent 43cb96f commit 403b7d2
Show file tree
Hide file tree
Showing 9 changed files with 141 additions and 73 deletions.
159 changes: 122 additions & 37 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,153 @@ name: Docker Image CI

on:
push:
branches: [main]
branches: [main, Pr1]
workflow_dispatch:

permissions:
packages: write

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
# ===============================================================
# Building Dev Image
# ===============================================================
build_dev:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
# Test of these containers
include:
- container: "alpine-dev:latest"
max-parallel: 6
matrix:
distro:
- name: "alpine-dev"
tag: latest
file: alpine-dev.Dockerfile
- container: "ubuntu-dev:20"
- name: "ubuntu-dev"
tag: 20
file: u20.04-dev.Dockerfile
- container: "ubuntu-dev:22"
- name: "ubuntu-dev"
tag: 22
file: u22.04-dev.Dockerfile
- container: "fedora:30"
- name: "fedora"
tag: 30
file: fedora30-dev.Dockerfile
# centos7 stopped working
# - container: "centos-dev:7"
# file: centos7-dev.Dockerfile
- container: "ubuntu-dev:24"
- name: "ubuntu-dev"
tag: 24
file: u24.04-dev.Dockerfile
- container: "benchmark-dev:latest"
file: benchmark-dev.Dockerfile
# - container: "benchmark-dev:latest"
# file: benchmark-dev.Dockerfile
image:
- name: ubuntu-24.04
arch: amd64
- name: ubuntu-24.04-arm
arch: arm64

runs-on: ${{ matrix.image.name }}
env:
image_base: ghcr.io/${{ github.repository_owner }}/${{ matrix.distro.name }}
steps:
- name: checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3

# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
with:
platforms: arm64,amd64
- name: Available platforms
run: echo ${{ steps.qemu.outputs.platforms }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

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

- name: Collect Docker metadata
id: metadata
uses: docker/metadata-action@v5
with:
images: ${{ env.image_base }}

- name: Build
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
id: build
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: |
ghcr.io/${{ github.actor }}/${{ matrix.container }}
file: ${{ matrix.file }}
file: ${{ matrix.distro.file }}
labels: ${{ steps.metadata.outputs.labels }}
outputs: type=image,name=${{ env.image_base }},push-by-digest=true,name-canonical=true,push=true

- name: Inspect Docker image
run: |
docker buildx imagetools inspect ${{ env.image_base }}:sha256@${{ steps.build.outputs.digest }}
- name: Test Docker image
run: docker run --rm "${{ env.image_base }}:sha256@${{ steps.build.outputs.digest }}" echo succeeded

- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-${{ matrix.distro.name }}-${{ matrix.distro.tag }}-${{ matrix.image.arch }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1

merge_manifest:
needs: [build_dev]
runs-on: ubuntu-latest
strategy:
matrix:
image:
- name: alpine-dev
tag: latest
- name: ubuntu-dev
tag: 20
- name: ubuntu-dev
tag: 22
- name: ubuntu-dev
tag: 24
- name: fedora
tag: 30
env:
image_base: ghcr.io/${{ github.repository_owner }}/${{ matrix.image.name }}
image: ghcr.io/${{ github.repository_owner }}/${{ matrix.image.name }}:${{matrix.image.tag}}

steps:
- uses: docker/setup-buildx-action@v3
- name: Download digests
uses: actions/download-artifact@v4
with:
path: /tmp/digests
pattern: digests-${{ matrix.image.name }}-${{ matrix.image.tag }}-*
merge-multiple: true

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

- name: Collect Docker metadata
id: metadata
uses: docker/metadata-action@v5
with:
images: ${{ env.image_base }}

- name: Create and push merged image
working-directory: /tmp/digests
run: |
tags=$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")
images=$(printf '${{ env.image_base }}@sha256:%s ' *)
echo "images: $images"
docker buildx imagetools create -t ${{ env.image }} ${images}
- name: Inspect Docker image
run: |
docker buildx imagetools inspect ${{ env.image }}
- name: Push the Docker image
if: github.event_name == 'push' && github.ref_name == 'main'
run: |
docker buildx imagetools create -t "${{ env.image }}
4 changes: 2 additions & 2 deletions alpine-dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1
FROM alpine:latest

LABEL org.opencontainers.image.source https://github.com/romange/container-foundry
LABEL org.opencontainers.image.source="https://github.com/romange/container-foundry"

# to allow installing mold
# RUN echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
Expand All @@ -12,7 +12,7 @@ LABEL org.opencontainers.image.source https://github.com/romange/container-found
# coreutils is needed so that mktemp will work as expected.

RUN apk add autoconf-archive automake bash bison boost-dev boost-static cmake coreutils \
curl ccache clang flex-dev git gcc gdb g++ libunwind-dev libtool libxml2-dev make ninja \
curl ccache clang flex-dev git gcc gdb g++ libunwind-dev libtool pcre2-dev make ninja \
openssl-dev patch zip zstd-dev lsof flatbuffers-dev moreutils
RUN apk add --no-cache tar

Expand Down
4 changes: 2 additions & 2 deletions benchmark-dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM bitnami/kubectl:1.29.4 as kubectl
FROM bitnami/kubectl:1.29.4 AS kubectl

# Use the base image
FROM ghcr.io/romange/ubuntu-dev:20 as base
FROM ghcr.io/romange/ubuntu-dev:20 AS base

# Install Node.js
RUN curl -fsSL https://deb.nodesource.com/setup_21.x | bash - && \
Expand Down
2 changes: 1 addition & 1 deletion fedora30-dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ COPY ./get_cmake.sh /tmp/

RUN dnf install -y automake gcc-c++ git libtool make ninja-build \
openssl-devel libunwind-devel autoconf-archive patch wget bzip2 \
openssl-static zlib-devel gdb ccache
openssl-static pcre2-devel zlib-devel gdb ccache

RUN dnf install -y bison libzstd-static --releasever=32

Expand Down
4 changes: 2 additions & 2 deletions install_boost.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -ex

BVER=1.83.0
BVER=1.84.0
BOOST=boost_${BVER//./_} # replace all . with _

# For sake of boost install we always use g++.
Expand All @@ -11,7 +11,7 @@ install_boost() {
mkdir -p /tmp/boost && pushd /tmp/boost

if ! [ -d $BOOST ]; then
url="https://boostorg.jfrog.io/artifactory/main/release/${BVER}/source/$BOOST.tar.bz2"
url="https://archives.boost.io/release/${BVER}/source/$BOOST.tar.bz2"
echo "Downloading from $url"
if ! [ -e $BOOST.tar.bz2 ]; then wget -nv ${url} -O $BOOST.tar.bz2; fi

Expand Down
6 changes: 3 additions & 3 deletions u20.04-dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1
FROM ubuntu:20.04

LABEL org.opencontainers.image.source https://github.com/romange/container-foundry
LABEL org.opencontainers.image.source="https://github.com/romange/container-foundry"

COPY ./get_mold.sh /tmp/
COPY ./install_versioned_redis.sh /tmp/
Expand All @@ -11,9 +11,9 @@ ENV DEBIAN_FRONTEND=noninteractive

RUN apt update
RUN apt install -y autoconf-archive bison cmake curl gdb git libssl-dev \
libunwind-dev libfl-dev ninja-build libtool redis wget \
libunwind-dev libfl-dev ninja-build libtool libpcre2-dev redis-tools wget \
gcc-9 g++-9 libboost-context-dev zip ccache libzstd-dev \
debhelper moreutils pip jq lsof lcov libflatbuffers-dev \
debhelper moreutils pip jq lsof lcov libflatbuffers-dev pkg-config \
&& rm -rf /var/lib/apt/lists/*

RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 40 \
Expand Down
4 changes: 2 additions & 2 deletions u22.04-dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
FROM ubuntu:22.04

LABEL org.opencontainers.image.source https://github.com/romange/container-foundry
LABEL org.opencontainers.image.source="https://github.com/romange/container-foundry"

COPY ./get_mold.sh /tmp/

# To avoid tzdata reconfigure
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y autoconf-archive bison cmake curl gdb git libssl-dev \
libunwind-dev libfl-dev ninja-build libtool \
gcc-11 g++-11 libboost-context-dev libxml2-dev zip ccache libzstd-dev \
gcc-11 g++-11 libboost-context-dev libpcre2-dev libxml2-dev zip ccache libzstd-dev \
debhelper moreutils pip jq lsof lcov netcat redis-tools \
&& rm -rf /var/lib/apt/lists/*

Expand Down
18 changes: 0 additions & 18 deletions u23.10-dev.Dockerfile

This file was deleted.

13 changes: 7 additions & 6 deletions u24.04-dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
FROM ubuntu:24.04

LABEL org.opencontainers.image.source https://github.com/romange/container-foundry
LABEL org.opencontainers.image.source="https://github.com/romange/container-foundry"

COPY ./get_mold.sh ./install_boost.sh /tmp/
COPY ./get_mold.sh /tmp/

# To avoid tzdata reconfigure
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y autoconf-archive bison cmake curl gdb git libssl-dev \
libunwind-dev libfl-dev ninja-build libtool clang \
libboost-context-dev libxml2-dev zip ccache libzstd-dev \

RUN apt update && apt install -y autoconf-archive bison clang cmake curl gdb git libssl-dev \
libunwind-dev libfl-dev ninja-build libtool \
libboost-context-dev libpcre2-dev libxml2-dev zip ccache libzstd-dev \
debhelper moreutils pip jq lsof lcov libflatbuffers-dev wget \
&& rm -rf /var/lib/apt/lists/*

RUN /tmp/get_mold.sh && /tmp/install_boost.sh --asan --ucontext
RUN /tmp/get_mold.sh

0 comments on commit 403b7d2

Please sign in to comment.