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