Add development Docker image (#67)

This commit is contained in:
demons 2025-03-04 16:24:37 +08:00 committed by GitHub
parent fc90de1110
commit 4b91bbb5c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 90 additions and 0 deletions

View File

@ -0,0 +1,52 @@
name: Build development Docker image
on:
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}-dev
jobs:
push_to_registry:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
id: push
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./dockerfile/dev.dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

38
dockerfile/dev.dockerfile Normal file
View File

@ -0,0 +1,38 @@
FROM ubuntu:22.04
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
RUN apt-get update &&\
apt-get install -y --no-install-recommends \
wget ca-certificates \
clang-format-14 clang-14 clang-tidy-14 lld-14 \
build-essential meson gcc-12 g++-12 cmake rustc cargo \
google-perftools \
libaio-dev \
libboost-all-dev \
libdouble-conversion-dev \
libdwarf-dev \
libgflags-dev \
libgmock-dev \
libgoogle-glog-dev \
libgoogle-perftools-dev \
libgtest-dev \
liblz4-dev \
liblzma-dev \
libssl-dev \
libunwind-dev \
libuv1-dev &&\
apt-get clean &&\
rm -rf /var/lib/apt/lists/*
ARG FDB_VERSION=7.1.61
ARG FDB_DOWNLOAD_URL=https://github.com/apple/foundationdb/releases/download/7.1.61/foundationdb-clients_${FDB_VERSION}-1_amd64.deb
RUN wget ${FDB_DOWNLOAD_URL} -O /tmp/foundationdb-clients.deb &&\
dpkg -i /tmp/foundationdb-clients.deb &&\
rm /tmp/foundationdb-clients.deb
ARG LIBFUSE_VERSION=3.16.2
ARG LIBFUSE_DOWNLOAD_URL=https://github.com/libfuse/libfuse/releases/download/fuse-${LIBFUSE_VERSION}/fuse-${LIBFUSE_VERSION}.tar.gz
RUN wget -O- ${LIBFUSE_DOWNLOAD_URL} |\
tar -xzvf - -C /tmp &&\
cd /tmp/fuse-${LIBFUSE_VERSION} &&\
mkdir build && cd build &&\
meson setup .. && ninja && ninja install &&\
rm -f -r /tmp/fuse-${LIBFUSE_VERSION}*