From 85b5384522c555ef74e7b7efc25c9f9b2bd19829 Mon Sep 17 00:00:00 2001 From: Arun Sharma Date: Thu, 26 Dec 2024 10:49:51 -0800 Subject: [PATCH 1/2] Initial version of alpine docker --- docker/linux_amd64/alpine/Dockerfile | 55 ++++++++++++++++++++++++++++ docker/linux_amd64/alpine/env.txt | 8 ++++ 2 files changed, 63 insertions(+) create mode 100644 docker/linux_amd64/alpine/Dockerfile create mode 100644 docker/linux_amd64/alpine/env.txt diff --git a/docker/linux_amd64/alpine/Dockerfile b/docker/linux_amd64/alpine/Dockerfile new file mode 100644 index 0000000..de8793d --- /dev/null +++ b/docker/linux_amd64/alpine/Dockerfile @@ -0,0 +1,55 @@ +FROM alpine:3.20 + +ARG DUCKDB_VER=v1.1.3 +ARG vcpkg_url="https://github.com/microsoft/vcpkg.git" +ARG vcpkg_commit="a1a1cbc975abf909a6c8985a6a2b8fe20bbd9bd6" + +# Install build dependencies +RUN apk update && \ + apk add --no-cache \ + build-base \ + ccache \ + cmake \ + curl \ + git \ + g++ \ + make \ + ninja \ + pkgconfig \ + python3 \ + rustup \ + tar \ + unzip \ + zip + +# Setup VCPKG n a mounted volume TODO: figure out how to cache this +RUN mkdir /vcpkg && \ + cd /vcpkg && \ + git init && \ + git remote add origin $vcpkg_url && \ + git fetch origin $vcpkg_commit && \ + git checkout $vcpkg_commit && \ + ./bootstrap-vcpkg.sh +ENV VCPKG_ROOT=/vcpkg +ENV VCPKG_TOOLCHAIN_PATH=/vcpkg/scripts/buildsystems/vcpkg.cmake + +# Common environment variables +ENV GEN=ninja + +# Specify where we expect the extension to be mounted and use that as working dir +VOLUME /duckdb_build_dir +WORKDIR /duckdb_build_dir + +# Mount for ccache to allow restoring ccache in GH actions +VOLUME /ccache_dir +ENV CCACHE_DIR=/ccache_dir +ENV CCACHE_COMPRESS=TRUE +ENV CCACHE_COMPRESSLEVEL=6 +ENV CCACHE_MAXSIZE=400M + +# extension-ci needs rust? + +# Install the Rust toolchain +RUN rustup-init -y --default-toolchain stable + +RUN git clone --branch $DUCKDB_VER https://github.com/duckdb/extension-ci-tools diff --git a/docker/linux_amd64/alpine/env.txt b/docker/linux_amd64/alpine/env.txt new file mode 100644 index 0000000..a914e89 --- /dev/null +++ b/docker/linux_amd64/alpine/env.txt @@ -0,0 +1,8 @@ +VCPKG_TARGET_TRIPLET=x64-linux +BUILD_SHELL=0 +OPENSSL_ROOT_DIR=/duckdb_build_dir/build/release/vcpkg_installed/x64-linux +OPENSSL_DIR=/duckdb_build_dir/build/release/vcpkg_installed/x64-linux +OPENSSL_USE_STATIC_LIBS=true +DUCKDB_PLATFORM=linux-x64 +DUCKDB_GIT_VERSION=1.1.3 +LINUX_CI_IN_DOCKER=1 From 501541c56b4ffd8dbc501680d7ffb90b766df834 Mon Sep 17 00:00:00 2001 From: Arun Sharma Date: Thu, 26 Dec 2024 17:42:20 -0800 Subject: [PATCH 2/2] Some bug fixes https://github.com/microsoft/vcpkg/issues/21218 https://github.com/microsoft/vcpkg/issues/33806 --- docker/linux_amd64/alpine/Dockerfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docker/linux_amd64/alpine/Dockerfile b/docker/linux_amd64/alpine/Dockerfile index de8793d..212c702 100644 --- a/docker/linux_amd64/alpine/Dockerfile +++ b/docker/linux_amd64/alpine/Dockerfile @@ -7,14 +7,17 @@ ARG vcpkg_commit="a1a1cbc975abf909a6c8985a6a2b8fe20bbd9bd6" # Install build dependencies RUN apk update && \ apk add --no-cache \ + bash \ build-base \ ccache \ cmake \ curl \ git \ g++ \ + linux-headers \ make \ - ninja \ + ninja-build \ + perl \ pkgconfig \ python3 \ rustup \ @@ -22,7 +25,9 @@ RUN apk update && \ unzip \ zip -# Setup VCPKG n a mounted volume TODO: figure out how to cache this +RUN ln -s /usr/lib/ninja-build/bin/ninja /usr/bin/ninja + +ENV VCPKG_FORCE_SYSTEM_BINARIES=1 RUN mkdir /vcpkg && \ cd /vcpkg && \ git init && \