From d0ef87d41dfb99ed03087f44a5423a299edb86d6 Mon Sep 17 00:00:00 2001 From: Raj Shah Date: Tue, 21 Jun 2022 02:07:17 +0000 Subject: [PATCH] Add package stage --- Dockerfile.mayhem | 11 ++++++++++- Mayhemfile | 3 +-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Dockerfile.mayhem b/Dockerfile.mayhem index 0be8082..43a6012 100644 --- a/Dockerfile.mayhem +++ b/Dockerfile.mayhem @@ -1,4 +1,4 @@ -FROM --platform=linux/amd64 ubuntu:20.04 +FROM --platform=linux/amd64 ubuntu:20.04 as builder RUN apt-get update RUN DEBIAN_FRONTEND=noninteractive apt-get install -y qtcreator qt5-default build-essential @@ -7,3 +7,12 @@ COPY . /repo WORKDIR /repo RUN qmake RUN make -j8 + +RUN mkdir -p /deps +RUN ldd /repo/cpi | tr -s '[:blank:]' '\n' | grep '^/' | xargs -I % sh -c 'cp % /deps;' + +FROM ubuntu:20.04 as package + +COPY --from=builder /deps /deps +COPY --from=builder /repo/cpi /repo/cpi +ENV LD_LIBRARY_PATH=/deps diff --git a/Mayhemfile b/Mayhemfile index 90b397c..633d292 100644 --- a/Mayhemfile +++ b/Mayhemfile @@ -1,6 +1,5 @@ -project: rnshah9/cpi +project: cpi target: cpi -tests: null cmds: - cmd: /repo/cpi @@