RetroShare/build_scripts/GitlabCI/base.Dockerfile

63 lines
2.2 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:22.04
2020-04-07 14:01:01 -04:00
2021-09-03 06:48:44 -04:00
ENV DEBIAN_FRONTEND=noninteractive
2022-02-25 10:57:07 -05:00
ENV APT_UNAT="--assume-yes --quiet"
RUN apt-get update $APT_UNAT && \
apt-get upgrade --show-upgraded $APT_UNAT && \
apt-get clean $APT_UNAT && \
apt-get install --no-install-recommends $APT_UNAT \
bash build-essential cimg-dev libssl-dev libbz2-dev \
libminiupnpc-dev \
libsqlite3-dev libsqlcipher-dev \
pkg-config libz-dev \
libxapian-dev doxygen rapidjson-dev \
git cmake curl python3
## Avoid git cloning spuriously failing with
# server certificate verification failed. CAfile: none CRLfile: none
RUN apt-get install --no-install-recommends $APT_UNAT --reinstall \
ca-certificates
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://github.com/RetroShare/RetroShare.git
2020-04-07 14:01:01 -04:00
ARG REPO_BRANCH=master
ARG REPO_DEPTH="--depth 2000"
RUN git clone $REPO_DEPTH $REPO_URL -b $REPO_BRANCH && \
cd RetroShare && \
2022-02-25 10:57:07 -05:00
git fetch --tags && \
git submodule update --init \
libbitdht/ libretroshare/ openpgpsdk/ retroshare-webui/ \
supportlibs/restbed/ && \
cd supportlibs/restbed/ && \
git submodule update --init \
dependency/asio/ dependency/kashmir/ && \
cd ../../../
2022-02-25 10:57:07 -05:00
RUN \
mkdir RetroShare-build && cd RetroShare-build && \
cmake -B. -S../RetroShare/retroshare-service \
-DRS_FORUM_DEEP_INDEX=ON -DRS_JSON_API=ON -DRS_WEBUI=ON && \
make -j$(nproc) && make install && \
2021-09-03 06:48:44 -04:00
cd .. && rm -rf RetroShare-build