1FROM obgm/libcoap:build-env 2 3RUN apt-get update && apt-get install -y cmake git g++ 4RUN apt-get clean 5 6ENV libcoap_dir=/home/libcoap 7ADD . $libcoap_dir 8WORKDIR $libcoap_dir 9 10RUN ./autogen.sh --clean && ./autogen.sh 11RUN ./configure --disable-documentation --enable-tests --enable-examples --with-openssl && make install clean 12 13WORKDIR /home 14RUN git clone --depth 1 https://github.com/cabo/cn-cbor.git && cd cn-cbor && ./build.sh all doc install 15 16# The image for development with libcoap 17FROM debian:testing-slim 18 19RUN apt-get update && apt-get install -y autoconf automake gcc g++ gdb libtool libtool-bin make \ 20 pkg-config libssl-dev libgnutls28-dev libmbedtls-dev 21RUN apt-get install -y iproute2 lsof net-tools inetutils-ping netcat-openbsd less vim 22RUN apt-get clean 23 24COPY --from=0 /usr/local/include/coap3 /usr/local/include/coap3 25COPY --from=0 /usr/local/lib /usr/local/lib 26COPY --from=0 /usr/local/bin/coap-client /usr/local/bin/ 27COPY --from=0 /usr/local/include/cn-cbor /usr/local/include/cn-cbor 28RUN echo "/usr/local/lib" >>/etc/ld.so.conf.d/usr_local.conf && ldconfig /usr/local/lib 29 30ARG user=user 31RUN adduser --disabled-password --gecos '' $user 32RUN chown -R $user:$user /home/$user 33WORKDIR /home/$user 34USER $user 35 36EXPOSE 5683 5684 37