FROM registry.hottis.de/dockerized/base-build-env:1.0.0

LABEL Maintainer="Wolfgang Hottgenroth <woho@hottis.de>"
LABEL ImageName="registry.hottis.de/dockerized/build-env-c"
LABEL AlternativeImageName="wollud1969/build-env-c"


RUN \
  apt update && \
  apt install -y gcc g++ libcunit1 libcunit1-dev && \
  apt install -y libcurl4-gnutls-dev && \
  apt install -y libmariadbclient-dev && \
  apt install -y libconfig-dev && \
  apt install -y libcunit1-dev && \
  apt install -y libssl-dev && \
  apt install -y valgrind && \
  mkdir /work && \
  useradd -d /work -u 1000 user && \
  rm -rf /var/lib/apt/lists/* 

RUN \
  cd / tmp && \
  git clone https://github.com/eclipse/paho.mqtt.c.git && \
  cd paho.mqtt.c && \
  make && \
  make install

VOLUME /work
WORKDIR /work

USER 1000:1000