Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
stages:
- build
- docker

.stealthmake:
stage: build
image: stealthsend/stealth-base-for-make
needs: []
script:
- cd src/
- make -f makefile.unix clean
- make -f makefile.unix
rules:
- if: $CI_COMMIT_BRANCH == "master"
when: never
- if: $CI_COMMIT_BRANCH
when: always

Make for qpos-3.0 on ubuntu 16.04:
extends: .stealthmake
image: stealthsend/stealth-base-for-make:16.04

Make for qpos-3.0 on ubuntu 18.04:
extends: .stealthmake
image: stealthsend/stealth-base-for-make:18.04

Make for qpos-3.0 on ubuntu 20.04:
extends: .stealthmake
image: stealthsend/stealth-base-for-make:20.04

120 changes: 0 additions & 120 deletions contrib/docker/Dockerfile

This file was deleted.

129 changes: 129 additions & 0 deletions contrib/docker/Dockerfile-ubuntu-16.04
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
FROM ubuntu:16.04 as build

# install bulk of dependencies
RUN apt-get update \
&& apt-get upgrade -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
wget vim-common jq ca-certificates git cmake autoconf build-essential \
openssl libssl-dev doxygen libncurses5-dev \
libreadline6 libreadline6-dev zlib1g-dev \
tcsh libbz2-dev libtool \
libssl-dev libprotobuf-dev \
protobuf-compiler pkg-config p7zip-full \
libcurl4-openssl-dev unzip curl python-dev \
libxml2-dev libxslt-dev libkrb5-dev

# install BDB and LibEvent
ENV HOME /root
RUN cd \
&& mkdir -p ${HOME}/Deps/bdb \
&& cd ${HOME}/Deps/bdb \
&& wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz \
&& echo '12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz' | sha256sum -c \
&& tar xvf db-4.8.30.NC.tar.gz \
&& cd db-4.8.30.NC/build_unix/ \
&& ../dist/configure --disable-shared --enable-cxx --with-pic --prefix=/usr/local \
&& make -j2 \
&& make install

# install libevent
RUN apt-get install -y --no-install-recommends libevent-dev

# set key environment variables
ENV DEPS ${HOME}/Deps
RUN cd ${DEPS}
ENV XSTDIR ${DEPS}/stealth
ENV XST_BRANCH qpos-3.0

# build boost
ENV BOOSTR 1
ENV BOOSTS 65
ENV BOOSTM 1
ENV BOOSTP ${BOOSTR}_${BOOSTS}_${BOOSTM}
ENV BOOSTV ${BOOSTR}.${BOOSTS}.${BOOSTM}
ENV BUILDDIR build-xst
ENV BOOST_ROOT ${DEPS}/boost/boost-xst

RUN mkdir -p ${DEPS}/boost \
&& wget https://sourceforge.net/projects/boost/files/boost/${BOOSTV}/boost_${BOOSTP}.tar.bz2 \
&& tar xvf boost_${BOOSTP}.tar.bz2 \
&& mkdir -p ${BOOST_ROOT} \
&& cd boost_${BOOSTP} \
&& ./bootstrap.sh \
&& ./b2 --prefix=$BOOST_ROOT --build-dir=${BUILDDIR} link=static install

# build the stealth client
ENV BOOST_LIB_PATH ${BOOST_ROOT}/lib
ENV BOOST_INCLUDE_PATH ${BOOST_ROOT}/include
ENV BOOST_LIB_SUFFIX ""

RUN mkdir -p ${XSTDIR} \
&& cd ${XSTDIR} \
&& git clone https://github.com/StealthSend/Stealth.git \
&& cd Stealth/src \
&& git checkout ${XST_BRANCH} \
&& make -f makefile.unix \
&& cp StealthCoind /usr/local/bin/StealthCoind

# grab gosu for easy step-down from root
ENV GOSU_VERSION 1.11
RUN set -x \
&& apt-get update \
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \
&& wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \
&& export GNUPGHOME="$(mktemp -d)" \
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
&& gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
&& rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu \
&& gosu nobody true \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# move repo binaries to local bin directory
COPY ./scripts /usr/local/bin
COPY docker-entrypoint.sh /usr/local/bin/

# make them executable
RUN chmod -R +x /usr/local/bin

#### FINAL STAGE ####
FROM phusion/baseimage:0.10.2

ARG USER_ID
ARG GROUP_ID

ENV HOME /stealth

# add user with specified (or default) user/group ids
ENV USER_ID ${USER_ID:-1000}
ENV GROUP_ID ${GROUP_ID:-1000}

# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
RUN groupadd -g ${GROUP_ID} stealth \
&& useradd -u ${USER_ID} -g stealth -s /bin/bash -m -d /stealth stealth

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libevent-dev ca-certificates wget p7zip-full \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# change to main workspace
WORKDIR /stealth

# copy binaries from build stage
COPY --from=build /usr/local/bin /bin

# create a volume for external configuration and blockchain data
VOLUME ["/stealth"]

# change ownership of the working directory
RUN chown -R stealth:stealth /stealth

# expose p2p and rpc ports
EXPOSE 4437 4438 46502 46503

# leave entrypoint for extra commands to run
ENTRYPOINT ["docker-entrypoint.sh"]

# main command to run when container starts
CMD ["stealth_oneshot"]
58 changes: 58 additions & 0 deletions contrib/docker/Dockerfile-ubuntu-16.04-base-for-make
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
FROM ubuntu:16.04 as build

# install bulk of dependencies
RUN apt-get update \
&& apt-get upgrade -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
wget vim-common jq ca-certificates git cmake autoconf build-essential \
openssl libssl-dev doxygen libncurses5-dev \
libreadline6 libreadline6-dev zlib1g-dev \
tcsh libbz2-dev libtool \
libssl-dev libprotobuf-dev \
protobuf-compiler pkg-config p7zip-full \
libcurl4-openssl-dev unzip curl python-dev \
libxml2-dev libxslt-dev libkrb5-dev

# install BDB and LibEvent
ENV HOME /root
RUN cd \
&& mkdir -p ${HOME}/Deps/bdb \
&& cd ${HOME}/Deps/bdb \
&& wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz \
&& echo '12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz' | sha256sum -c \
&& tar xvf db-4.8.30.NC.tar.gz \
&& cd db-4.8.30.NC/build_unix/ \
&& ../dist/configure --disable-shared --enable-cxx --with-pic --prefix=/usr/local \
&& make -j2 \
&& make install

# install libevent
RUN apt-get install -y --no-install-recommends libevent-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# set key environment variables
ENV DEPS ${HOME}/Deps
RUN cd ${DEPS}
ENV XSTDIR ${DEPS}/stealth

# build boost
ENV BOOSTR 1
ENV BOOSTS 65
ENV BOOSTM 1
ENV BOOSTP ${BOOSTR}_${BOOSTS}_${BOOSTM}
ENV BOOSTV ${BOOSTR}.${BOOSTS}.${BOOSTM}
ENV BUILDDIR build-xst
ENV BOOST_ROOT ${DEPS}/boost/boost-xst

RUN mkdir -p ${DEPS}/boost \
&& wget https://sourceforge.net/projects/boost/files/boost/${BOOSTV}/boost_${BOOSTP}.tar.bz2 \
&& tar xvf boost_${BOOSTP}.tar.bz2 \
&& mkdir -p ${BOOST_ROOT} \
&& cd boost_${BOOSTP} \
&& ./bootstrap.sh \
&& ./b2 --prefix=$BOOST_ROOT --build-dir=${BUILDDIR} link=static install

# build the stealth client
ENV BOOST_LIB_PATH ${BOOST_ROOT}/lib
ENV BOOST_INCLUDE_PATH ${BOOST_ROOT}/include
ENV BOOST_LIB_SUFFIX ""
Loading