浏览代码

Adds dockerfile

This uses alpine linux and attempts to create a minimal install with tools to develop using open62541
Copies the amalgamated header file into /usr/include and the dynamic and static libraries into /usr/lib
This should allow default gcc to pick them up easy enough

A second dockerfile is provided that performs all the actions in
one-step. This breaks docker layer caching, but ends up with a tiny
image that has the headers/libs compiled.

:

This is so the resulting dockerfile is super tiny
Beau Trepp 8 年之前
父节点
当前提交
fdc03a25f1
共有 2 个文件被更改,包括 19 次插入0 次删除
  1. 8 0
      Dockerfile
  2. 11 0
      TinyDockerfile

+ 8 - 0
Dockerfile

@@ -0,0 +1,8 @@
+FROM alpine:3.3
+RUN apk add --no-cache cmake gcc musl-dev python py-lxml make && rm -rf /var/cache/apk/*
+ADD . /tmp/open62541
+WORKDIR /tmp/open62541/build
+RUN cmake -D UA_ENABLE_AMALGAMATION=true /tmp/open62541 && make
+RUN cp *.h /usr/include/ && \
+    cp *.so /usr/lib && \
+    cp *.a /usr/lib

+ 11 - 0
TinyDockerfile

@@ -0,0 +1,11 @@
+FROM alpine:3.3
+ADD . /tmp/open62541
+WORKDIR /tmp/open62541/build
+RUN apk add --no-cache cmake gcc musl-dev python py-lxml make && rm -rf /var/cache/apk/* && \
+    cmake -D UA_ENABLE_AMALGAMATION=true /tmp/open62541 && \
+    make && \
+    cp *.h /usr/include/ && \
+    cp *.so /usr/lib && \
+    cp *.a /usr/lib && \
+    make clean && \
+    apk del cmake gcc musl-dev python py-lxml make