From af5ebbb92533d1015336f2257bfe5e7dc67c2494 Mon Sep 17 00:00:00 2001 From: Riccardo Schirone Date: Fri, 12 Feb 2021 19:48:12 +0100 Subject: [PATCH] Dockerfile: take rizin source code from context (#602) --- .github/workflows/ci.yml | 2 +- Dockerfile | 35 ++++++++++++++++++++--------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 453b48989d..54fe43b202 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -765,7 +765,7 @@ jobs: name: Publish Docker image on Docker Hub needs: [build-and-test] runs-on: ubuntu-20.04 - if: github.event_name == 'push' + if: github.event_name == 'push' || (github.event_name == 'pull_request' && contains(github.head_ref, 'docker')) steps: - uses: actions/checkout@v2 - name: Install dependencies diff --git a/Dockerfile b/Dockerfile index d526c1cf93..6bf881af1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,11 +33,6 @@ # Using debian 10 as base image. FROM debian:10 -# Label base -LABEL rizin latest - -# Radare version -ARG RZ_VERSION=dev # rz-pipe python version ARG RZ_PIPE_PY_VERSION=master @@ -45,15 +40,13 @@ ARG with_arm32_as ARG with_arm64_as ARG with_ppc_as -ENV RZ_VERSION ${RZ_VERSION} ENV RZ_PIPE_PY_VERSION ${RZ_PIPE_PY_VERSION} RUN echo -e "Building versions:\n\ - RZ_VERSION=$RZ_VERSION\n\ RZ_PIPE_PY_VERSION=${RZ_PIPE_PY_VERSION}" # Build rizin in a volume to minimize space used by build -VOLUME ["/mnt"] +COPY . /tmp/rizin/ # Install all build dependencies # Install bindings @@ -62,27 +55,39 @@ VOLUME ["/mnt"] # Cleanup # gcc git python3-pip ccache patch # pip3 install meson ninja + RUN apt-get update && \ - apt-get install -y \ + apt-get install -y --no-install-recommends \ cmake \ gcc \ + cpp \ + g++ \ git \ + make \ + libc-dev-bin libc6-dev linux-libc-dev \ python3-pip \ + python3-setuptools \ + python3-wheel \ ${with_arm64_as:+binutils-aarch64-linux-gnu} \ ${with_arm32_as:+binutils-arm-linux-gnueabi} \ ${with_ppc_as:+binutils-powerpc64le-linux-gnu} && \ pip3 install meson ninja && \ - cd /mnt && \ + cd /tmp && \ git clone -b "$RZ_PIPE_PY_VERSION" https://github.com/rizinorg/rz-pipe && \ pip3 install ./rz-pipe/python && \ - git clone -b "$RZ_VERSION" https://github.com/rizinorg/rizin.git && \ cd rizin && \ - meson build && \ - meson compile -C build && \ - meson install -C build && \ + meson --prefix=/usr /tmp/build && \ + meson compile -C /tmp/build && \ + meson install -C /tmp/build && \ + rm -rf /tmp/build && \ pip3 uninstall -y meson ninja && \ apt-get remove --purge -y \ - python3-pip gcc cmake &&\ + cmake \ + cpp \ + g++ \ + python3-pip \ + python3-setuptools \ + python3-wheel && \ apt-get autoremove --purge -y && \ apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*