-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from paulgrainger85/master
Add Alpine docker environment and ARM64 instructions
- Loading branch information
Showing
5 changed files
with
106 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
FROM alpine:3.14 | ||
|
||
RUN mkdir -p /q/l64 | ||
RUN mkdir -p /source/paho.mqtt.c | ||
RUN mkdir -p /source/mqtt/examples | ||
RUN mkdir -p /source/mqtt/q | ||
RUN mkdir -p /source/mqtt/src | ||
RUN mkdir -p /source/mqtt/include | ||
|
||
COPY docker_linux/mqtt_build.sh /source | ||
|
||
COPY CMakeLists.txt /source/mqtt | ||
COPY docker_linux/build_libpaho.sh /source/mqtt | ||
COPY install.sh /source/mqtt | ||
COPY README.md /source/mqtt | ||
COPY LICENSE /source/mqtt | ||
|
||
COPY examples/ /source/mqtt/examples | ||
COPY src/ /source/mqtt/src | ||
COPY include/ /source/mqtt/include | ||
COPY q/mqtt.q /q/ | ||
|
||
ENV QHOME /q | ||
ENV PATH /q/l64:$PATH | ||
ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH | ||
ENV MQTT_INSTALL_DIR /source/paho.mqtt.c | ||
ENV BUILD_HOME /source/paho.mqtt.c | ||
|
||
RUN apk add --update && \ | ||
apk add build-base && \ | ||
apk add cmake && \ | ||
apk add make && \ | ||
apk add openssl-dev && \ | ||
apk add wget && \ | ||
apk add gcompat && \ | ||
apk add libnsl && \ | ||
cd /source && \ | ||
|
||
# MQTT Libs | ||
/bin/sh /source/mqtt/build_libpaho.sh && \ | ||
|
||
# Clean up | ||
apk del gcc && \ | ||
apk del cmake && \ | ||
apk del make && \ | ||
apk del wget && \ | ||
apk del build-base && \ | ||
rm -rf /source/mqtt_build.sh /source/paho.mqtt.c /source/v1.3.9* /source/mqtt/CmakeLists.txt | ||
|
||
## Update this section here to add kdb+ | ||
#COPY q/k4.lic /q/ | ||
#COPY q/q.k /q/ | ||
#COPY q/l64/q /q/l64 | ||
|
||
## If running licensed version of kdb, you may also need taskset to start the process | ||
# apk add util-linux | ||
|
||
WORKDIR /source | ||
|
||
ENTRYPOINT ["/bin/sh"] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/sh | ||
|
||
cd /source | ||
|
||
wget https://github.com/eclipse/paho.mqtt.c/archive/refs/tags/v1.3.9.tar.gz | ||
tar xvf v1.3.9.tar.gz -C ./paho.mqtt.c --strip-components=1 | ||
|
||
cd paho.mqtt.c | ||
|
||
# This library is not present in the Alpine image, removing it from the compiler args | ||
sed -i 's/GAI_LIB = -lanl/#GAI_LIB = -lanl/g' Makefile | ||
ln -s /usr/lib/libnsl.so.2 /usr/lib/libnsl.so.1 | ||
|
||
make | ||
make install | ||
mkdir -p include/lib | ||
cd include/lib | ||
|
||
ln -s /usr/local/lib/libpaho-mqtt3c.so libpaho-mqtt3c.a | ||
ln -s /usr/local/lib/libpaho-mqtt3cs.so libpaho-mqtt3cs.a | ||
ln -s /usr/local/lib/libpaho-mqtt3as.so libpaho-mqtt3as.a | ||
ln -s /usr/local/lib/libpaho-mqtt3a.so libpaho-mqtt3a.a | ||
|
||
mkdir /source/mqtt/cmake | ||
cd /source/mqtt/cmake | ||
cmake .. | ||
make | ||
make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters