Skip to content

Commit fc018f1

Browse files
authored
feat: slimmer docker images (#136)
* feature: make cpp-sysroot image slimmer * feat(docker): base from ubuntu 24.04 * fix(ci): add apt update before libffi * fix(ffi): install missing package * fix(docker): add clang-format-17
1 parent 655917b commit fc018f1

File tree

5 files changed

+37
-14
lines changed

5 files changed

+37
-14
lines changed

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
SYSROOT_VERSION=0.7.0
2-
SYSROOT_CLI_IMAGE=ghcr.io/faasm/cpp-sysroot:0.7.0
1+
SYSROOT_VERSION=0.8.0
2+
SYSROOT_CLI_IMAGE=ghcr.io/faasm/cpp-sysroot:0.8.0
33
COMPOSE_PROJECT_NAME=cpp-dev

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
if: github.event.pull_request.draft == false
1818
runs-on: ubuntu-latest
1919
container:
20-
image: ghcr.io/faasm/cpp-sysroot:0.7.0
20+
image: ghcr.io/faasm/cpp-sysroot:0.8.0
2121
steps:
2222
# --- Update code ---
2323
- name: "Checkout code"

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.7.0
1+
0.8.0

docker/cpp-sysroot.dockerfile

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,44 @@
11
# llvm image is not re-built often, so the tag may be behind
22
FROM ghcr.io/faasm/llvm:0.7.0 AS llvm
33

4-
# faabric-base image is not re-built often, so tag may be behind
5-
FROM ghcr.io/faasm/faabric-base:0.21.0
4+
# Start from a fresh ubuntu image, cpp-sysroot has little built deps.
5+
FROM ubuntu:24.04
6+
7+
RUN apt update \
8+
&& apt install -y --no-install-recommends \
9+
autoconf \
10+
automake \
11+
autopoint \
12+
autotools-dev \
13+
clang-17 \
14+
clang-format-17 \
15+
cmake \
16+
dpkg-dev \
17+
gawk \
18+
gettext \
19+
git \
20+
libltdl-dev \
21+
libtool \
22+
llvm-17 \
23+
make \
24+
m4 \
25+
ninja-build \
26+
pkg-config \
27+
python3-pip \
28+
python3-venv \
29+
vim-tiny \
30+
&& apt autoremove \
31+
&& rm -rf /var/lib/apt/lists/*
32+
633
SHELL ["/bin/bash", "-c"]
734
ENV CPP_DOCKER="on"
835

9-
# Copy the toolchain and LLVM sources from the LLVM container
36+
# Copy the toolchain and LLVM OpenMP sources necessary to build libfaasmp
1037
COPY --from=llvm /usr/local/faasm /usr/local/faasm
11-
COPY --from=llvm /opt/llvm-project /opt/llvm-project
38+
COPY --from=llvm \
39+
/opt/llvm-project/build/llvm/projects/openmp/runtime/src \
40+
/opt/llvm-project/build/llvm/projects/openmp/runtime/src
1241

13-
# Update APT dependencies
14-
RUN apt update && apt install -y autotools-dev
1542
# Get the code and submodules
1643
ARG SYSROOT_VERSION
1744
RUN mkdir -p /code \
@@ -42,9 +69,6 @@ RUN cd /code/cpp \
4269
libfaasmpi --native --shared \
4370
# Install toolchain files
4471
&& inv install \
45-
# Build wasi-libc and reset the sysroot. The second call to LLVM just
46-
# installs some headers that are purged
47-
&& inv llvm.libc --purge llvm \
4872
# Build Faasm WASM libraries for wasm32-wasi target
4973
&& inv \
5074
libfaasm \

libfaasmp/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ set(LIB_FILES
1616
if (CMAKE_SYSTEM_NAME STREQUAL "WASI")
1717
message(STATUS "Libfaasmp WebAssembly build")
1818

19-
set(LLVM_OMP_SRC_DIR "/opt/llvm-project/openmp/runtime/src")
2019
set(LLVM_OMP_BUILD_SRC_DIR "/opt/llvm-project/build/llvm/projects/openmp/runtime/src")
2120
set(LIBOMP_ASMFILES "z_Linux_asm.S")
2221
set(LIBOMP_HEADERS "${LLVM_OMP_BUILD_SRC_DIR}/omp.h")

0 commit comments

Comments
 (0)