Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
kiyoon committed Oct 16, 2024
1 parent 938665d commit 3a4bd2a
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
20 changes: 20 additions & 0 deletions build_reduce_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

if [[ $OSTYPE != "linux-gnu" ]]; then
echo "❌ This script is intended to be run on a Linux system."
exit 1
fi

if [[ $# -ge 1 ]]; then
REDUCE_RELEASE_TAG=$1
else
echo "usage: $0 <REDUCE-RELEASE-TAG>"
fi

docker build . -f linux_build.Dockerfile -t reduce-build --build-arg REDUCE_RELEASE_TAG="$REDUCE_RELEASE_TAG"

docker rm -f reducecontainer
docker create -ti --name reducecontainer reduce-build bash
docker cp reducecontainer:/opt/build .
docker rm -f reducecontainer

File renamed without changes.
23 changes: 23 additions & 0 deletions linux_build.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM ubuntu:18.04 as builder
## USAGE: docker build . -f linux_build.Dockerfile -t reduce-appimage --build-arg REDUCE_RELEASE_TAG=v4.14
RUN apt-get update && apt-get install -y \
g++ make cmake \
curl git

ENV BUILD_DIR=/opt/build
RUN mkdir -p $BUILD_DIR

FROM builder as appimage
ARG REDUCE_RELEASE_TAG='master'
## Fetch Code
WORKDIR /opt
RUN git clone -b $REDUCE_RELEASE_TAG --depth 1 https://github.com/rlabduke/reduce
ENV REPO_ROOT=/opt/reduce

## Build
WORKDIR $REPO_ROOT
ENV LD_LIBRARY_PATH="$BUILD_DIR/lib"
ENV CPPFLAGS="-I$BUILD_DIR/include"
ENV LDFLAGS="-L$BUILD_DIR/lib"
RUN cmake . -DCMAKE_INSTALL_PREFIX="$BUILD_DIR"
RUN make -j4 && make install

0 comments on commit 3a4bd2a

Please sign in to comment.