FROM debian:buster-slim

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
    && apt-get install -y \
        build-essential \
        debhelper \
        devscripts \
        reprepro \
        sudo

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        curl \
        ca-certificates \
        gnupg2 \
        libfontconfig \
    && curl -sL https://deb.nodesource.com/setup_10.x | bash - \
    && apt-get install -y --no-install-recommends \
        nodejs

RUN groupadd -g 1000 jenkins \
    && useradd -d /var/jenkins_home -u 1000 -g 1000 -m -s /bin/bash jenkins \
    && echo "jenkins ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/jenkins \
    && mkdir /reprepro

VOLUME ["/reprepro"]

COPY vn-includedeb /usr/bin/
