From a80be616f60d75b2a232dfadd7aef2e82acf6a8a Mon Sep 17 00:00:00 2001 From: Armin Friedl Date: Wed, 24 Feb 2021 21:36:27 +0100 Subject: [PATCH] Split shared and static build container --- .drone.yml | 18 ++++++++++++++-- Dockerfile | 23 -------------------- glibc-shared/Dockerfile | 23 ++++++++++++++++++++ entrypoint.sh => glibc-shared/entrypoint.sh | 0 musl-static/Dockerfile | 24 +++++++++++++++++++++ musl-static/entrypoint.sh | 5 +++++ 6 files changed, 68 insertions(+), 25 deletions(-) delete mode 100644 Dockerfile create mode 100644 glibc-shared/Dockerfile rename entrypoint.sh => glibc-shared/entrypoint.sh (100%) create mode 100644 musl-static/Dockerfile create mode 100755 musl-static/entrypoint.sh diff --git a/.drone.yml b/.drone.yml index 8f56df4..747fbe7 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,12 +2,26 @@ kind: pipeline name: default steps: -- name: docker +- name: glibc-shared image: plugins/docker settings: + dockerfile: glibc-shared/Dockerfile username: from_secret: docker_username password: from_secret: docker_password repo: arminfriedl/xwim-build - tags: latest + tags: + - shared + +- name: musl-static + image: plugins/docker + settings: + dockerfile: musl-static/Dockerfile + username: + from_secret: docker_username + password: + from_secret: docker_password + repo: arminfriedl/xwim-build + tags: + - static diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index ea2c7d6..0000000 --- a/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM ubuntu:rolling - -# Needed to prevent ubuntu from showing interactive -# dialog when e.g. installing tzdata -ARG DEBIAN_FRONTEND=noninteractive - -RUN apt-get update -y && apt-get upgrade -y && apt-get install -y\ - # Base dependencies for: `git push` xwim build - ## meson/build essentials - build-essential cmake pkg-config meson ninja-build g++ doxygen git \ - ## test coverage generator - gcovr \ - ## xwim dependencies - libspdlog-dev libfmt-dev libarchive-dev libtclap-dev \ - # Dependencies for release build/libarchive build - zip \ - && mkdir /build/ - -COPY ./entrypoint.sh /usr/local/bin - -WORKDIR /build/ - -CMD ["entrypoint.sh"] diff --git a/glibc-shared/Dockerfile b/glibc-shared/Dockerfile new file mode 100644 index 0000000..fda7333 --- /dev/null +++ b/glibc-shared/Dockerfile @@ -0,0 +1,23 @@ +FROM ubuntu:rolling + +# Needed to prevent ubuntu from showing interactive +# dialog when e.g. installing tzdata +ARG DEBIAN_FRONTEND=noninteractive + +RUN apt-get update -y && apt-get upgrade -y && apt-get install -y\ +# Base dependencies for: `git push` xwim build +## meson/build essentials +build-essential cmake pkg-config meson ninja-build g++ doxygen git \ +## test coverage generator +gcovr \ +## xwim dependencies +libspdlog-dev libfmt-dev libarchive-dev libtclap-dev \ +# Dependencies for release build/libarchive build +zip \ +&& mkdir /build/ + +COPY ./entrypoint.sh /usr/local/bin + +WORKDIR /build/ + +CMD ["entrypoint.sh"] diff --git a/entrypoint.sh b/glibc-shared/entrypoint.sh similarity index 100% rename from entrypoint.sh rename to glibc-shared/entrypoint.sh diff --git a/musl-static/Dockerfile b/musl-static/Dockerfile new file mode 100644 index 0000000..22fc53b --- /dev/null +++ b/musl-static/Dockerfile @@ -0,0 +1,24 @@ +FROM alpine:3.13 + +ENV LDFLAGS="-static-libgcc -static-libstdc++ -static" + +RUN apk add --no-cache \ + build-base cmake git meson pkgconf doxygen graphviz \ + libarchive-static libarchive-dev \ + libressl-dev \ + tclap-dev \ + bzip2-static acl-static expat-static zstd-static lz4-static zlib-static xz-dev + +WORKDIR /build/ + +RUN git clone --depth 1 --branch 7.1.3 https://github.com/fmtlib/fmt.git \ + && git clone --depth 1 --branch v1.8.2 https://github.com/gabime/spdlog.git + +RUN cd fmt && mkdir build && cd build \ + && cmake -DFMT_DOC=FALSE -DFMT_TEST=FALSE -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE --target fmt .. && make -j && make install + +RUN cd spdlog && mkdir build && cd build \ + && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE .. && make -j && make install + +COPY ./entrypoint.sh /usr/local/bin +CMD ["entrypoint.sh"] diff --git a/musl-static/entrypoint.sh b/musl-static/entrypoint.sh new file mode 100755 index 0000000..da6c149 --- /dev/null +++ b/musl-static/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +meson --buildtype release --strip --layout flat --default-library static target +ninja -C target +strip target/meson-out/xwim