blob: af96bc5cdbc30bb27d86f6bc808f086470089c7e [file] [log] [blame]
FROM debian:jessie-backports
ENV DEB_DIST_DIR=/dist
ENV BUILD_HOME=/home/build
ENV CASSANDRA_DIR=$BUILD_HOME/cassandra
LABEL org.cassandra.buildenv=jessie
VOLUME ${DEB_DIST_DIR}
# install deps
RUN apt-get update && apt-get -y install \
ant \
build-essential \
curl \
devscripts \
git \
sudo
RUN apt-get -y -t jessie-backports --no-install-recommends install \
openjdk-7-jdk \
openjdk-8-jdk
RUN apt-get -y -t jessie-backports install \
python-sphinx \
python-sphinx-rtd-theme
RUN update-java-alternatives --set java-1.8.0-openjdk-amd64
# create and change to build user
RUN adduser --disabled-login --gecos build build && gpasswd -a build sudo
RUN echo "build ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/build && \
chmod 0440 /etc/sudoers.d/build
USER build
# clone Cassandra and cache maven artifacts
ARG CASSANDRA_GIT_URL=https://gitbox.apache.org/repos/asf/cassandra.git
RUN git clone ${CASSANDRA_GIT_URL} ${CASSANDRA_DIR}
WORKDIR ${CASSANDRA_DIR}
RUN ant maven-ant-tasks-retrieve-build
COPY build-debs.sh $BUILD_HOME/