RetroShare/build_scripts/GitlabCI/base.Dockerfile

45 lines
1.7 KiB
Docker
Raw Normal View History

2020-04-07 14:01:01 -04:00
## Add +--build-arg FRESHCLONE=$(date +%s)+ to docker build commandline to
## force cloning a new
## To prepare an image suitable as base for Gitlab CI use
2021-09-03 06:48:44 -04:00
# export CI_REGISTRY_IMAGE="registry.gitlab.com/retroshare/retroshare:base"
# docker build -t "${CI_REGISTRY_IMAGE}" -f base.Dockerfile .
2020-04-07 14:01:01 -04:00
## To push it to gitlab CI registry you need first to login and the to push
# docker login registry.gitlab.com
2021-09-03 06:48:44 -04:00
# docker push "${CI_REGISTRY_IMAGE}"
2020-04-07 14:01:01 -04:00
## To run the container
2021-09-03 06:48:44 -04:00
# docker run -it -p 127.0.0.1:9092:9092 "${CI_REGISTRY_IMAGE}" retroshare-service --jsonApiPort 9092 --jsonApiBindAddress 0.0.0.0
2020-04-07 14:01:01 -04:00
FROM ubuntu
2021-09-03 06:48:44 -04:00
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && apt-get upgrade -y -qq && \
apt-get install -y -qq build-essential cimg-dev libssl-dev libbz2-dev \
libsqlite3-dev \
2020-04-07 14:01:01 -04:00
libsqlcipher-dev libupnp-dev pkg-config libz-dev \
qt5-default libxapian-dev qttools5-dev doxygen rapidjson-dev \
git cmake curl
2020-04-07 14:01:01 -04:00
2021-09-03 06:48:44 -04:00
RUN git clone --depth 1 https://github.com/aetilius/pHash.git && \
rm -rf pHash-build && mkdir pHash-build && cd pHash-build && \
cmake -B. -H../pHash -DCMAKE_INSTALL_PREFIX=/usr && \
make -j$(nproc) && make install && cd .. && \
2021-09-03 06:48:44 -04:00
rm -rf pHash-build pHash
2020-04-07 14:01:01 -04:00
ARG FRESHCLONE=0
ARG REPO_URL=https://gitlab.com/RetroShare/RetroShare.git
ARG REPO_BRANCH=master
ARG REPO_DEPTH="--depth 2000"
RUN git clone $REPO_DEPTH $REPO_URL -b $REPO_BRANCH && cd RetroShare && \
git fetch --tags && cd ..
2021-09-03 06:48:44 -04:00
RUN mkdir RetroShare-build && cd RetroShare-build && \
2020-04-07 14:01:01 -04:00
qmake ../RetroShare \
2021-09-03 06:48:44 -04:00
CONFIG+=no_retroshare_plugins \
2020-04-07 14:01:01 -04:00
CONFIG+=retroshare_service CONFIG+=no_retroshare_gui \
CONFIG+=rs_jsonapi CONFIG+=rs_deep_search && \
(make -j$(nproc) || make -j$(nproc) || make) && make install && \
2021-09-03 06:48:44 -04:00
cd .. && rm -rf RetroShare-build