From 8a77726b35521be9bccc1f6db507cc4690261ae9 Mon Sep 17 00:00:00 2001 From: Dhanush Muralidharan Date: Fri, 11 Sep 2026 15:31:16 +0530 Subject: [PATCH] Migrate from Alpine/musl to wolfi/glibc --- Dockerfile | 13 +++++++++---- Makefile | 2 +- src/avplumber.cpp | 11 ++++++----- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index f7a9d5fe..81cf5963 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,11 @@ -FROM alpine:3.21 AS builder +ARG WOLFI_IMAGE=public.ecr.aws/amagi-media-labs-sec/secure-container-base/wolfi-base -RUN apk add ffmpeg-dev git g++ cmake build-base curl-dev openssl-dev libssl3 boost-dev perl bash automake autoconf libtool +FROM ${WOLFI_IMAGE} AS builder + +RUN apk add --no-cache \ + ffmpeg-dev git gcc cmake build-base \ + curl-dev openssl-dev boost-dev \ + perl bash automake autoconf libtool # We build dependencies first because they'll probably change less often than src/ # so we can use Docker build cache to save some time @@ -19,8 +24,8 @@ COPY .git /build/.git RUN make -C /build -j `nproc` -FROM alpine:3.21 +FROM ${WOLFI_IMAGE} -RUN apk add ffmpeg libcurl libssl3 musl boost-thread +RUN apk add --no-cache ffmpeg libcurl-openssl4 boost-thread COPY --from=builder /build/avplumber /usr/local/bin/ ENTRYPOINT ["/usr/local/bin/avplumber"] diff --git a/Makefile b/Makefile index 1a9a1408..37bf8a2b 100644 --- a/Makefile +++ b/Makefile @@ -84,7 +84,7 @@ nodes_list_file = graph_factory.generated.cpp CPPSRC = avplumber.cpp util.cpp avutils.cpp graph_core.cpp graph_mgmt.cpp stats.cpp output_control.cpp instance_shared.cpp hwaccel_mgmt.cpp EventLoop.cpp TickSource.cpp rest_client.cpp mixer/mixer_orchestrator.cpp DEPS_LIBS = deps/cpr/build/lib/libcpr.a deps/avcpp/build/src/libavcpp.a # Python extension links via PYTHON_MODULE_EXTRA_LFLAGS (python3-config; -lpython3 is not a valid soname on many distros). -LIBS_FLAGS = -lpthread -lcurl -lssl -lcrypto -lboost_thread -lboost_system -lavcodec -lavfilter -lavutil -lavformat -lavdevice -lswscale -lswresample -ldl -lz +LIBS_FLAGS = -lpthread -lcurl -lssl -lcrypto -lboost_thread -lavcodec -lavfilter -lavutil -lavformat -lavdevice -lswscale -lswresample -ldl -lz ifeq ($(HAVE_JACK),1) NODES_SRC += $(shell find $(SRCDIR)/nodes/jack -maxdepth 1 -name '*.cpp') diff --git a/src/avplumber.cpp b/src/avplumber.cpp index d36f052d..a4901328 100644 --- a/src/avplumber.cpp +++ b/src/avplumber.cpp @@ -6,7 +6,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -1127,13 +1128,13 @@ class TcpControlServer: public ControlServerBase { ControlImpl &control; TcpControlServer &server; std::list>::iterator iter; - boost::asio::io_service &io_service; + boost::asio::io_context &io_service; tcp::socket socket; boost::asio::streambuf buff; ClientPipe pipe; std::thread thread; bool closing = false; - Client(ControlImpl &_control, TcpControlServer &_server, boost::asio::io_service &_io_service): + Client(ControlImpl &_control, TcpControlServer &_server, boost::asio::io_context &_io_service): control(_control), server(_server), io_service(_io_service), socket(_io_service), pipe([this]() { postToClient(); @@ -1147,7 +1148,7 @@ class TcpControlServer: public ControlServerBase { } void postToClient() { auto self = shared_from_this(); - io_service.post([self]() { + boost::asio::post(io_service, [self]() { self->sendToClient(); }); } @@ -1206,7 +1207,7 @@ class TcpControlServer: public ControlServerBase { }; ControlImpl &control_; - boost::asio::io_service io_service_; + boost::asio::io_context io_service_; tcp::acceptor acceptor_; // clients_ is mutated only from the io_service thread (net_thread_): // accept() inserts, Client::closeAndRemove() erases via the saved iterator.