FROM linaro/ci-#{ARCH}-tcwg-base-ubuntu:#{DISTRO}

RUN new-user.sh --user tcwg-buildslave \
 && sudo -i -u tcwg-buildslave mkdir bin
COPY lnt.sh /home/tcwg-buildslave/bin

COPY run.sh start.sh /

ENV TINI_VERSION v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-#{ARCH} /sbin/tini
RUN chmod +x /sbin/tini

ENTRYPOINT ["/sbin/tini", "--", "/run.sh"]
CMD ["start.sh"]
