Dockerfile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. FROM alpine:3.10
  2. RUN apk add --no-cache cmake gcc git g++ musl-dev mbedtls-dev python py-pip make && rm -rf /var/cache/apk/*
  3. ADD . /opt/open62541
  4. # Get all the git tags to make sure we detect the correct version with git describe
  5. WORKDIR /opt/open62541
  6. RUN git remote add github-upstream https://github.com/open62541/open62541.git
  7. RUN git fetch --tags github-upstream
  8. WORKDIR /opt/open62541/build
  9. RUN cmake -DBUILD_SHARED_LIBS=ON \
  10. -DCMAKE_BUILD_TYPE=Debug \
  11. -DUA_BUILD_EXAMPLES=ON \
  12. # Hardening needs to be disabled, otherwise the docker build takes too long and travis fails
  13. -DUA_ENABLE_HARDENING=OFF \
  14. -DUA_ENABLE_ENCRYPTION=ON \
  15. -DUA_ENABLE_SUBSCRIPTIONS=ON \
  16. -DUA_ENABLE_SUBSCRIPTIONS_EVENTS=ON \
  17. -DUA_NAMESPACE_ZERO=FULL \
  18. /opt/open62541
  19. RUN make -j
  20. RUN make install
  21. WORKDIR /opt/open62541
  22. RUN rm -rf /opt/open62541/build
  23. # Generate certificates
  24. RUN apk add --no-cache python-dev linux-headers openssl && rm -rf /var/cache/apk/*
  25. RUN pip install netifaces==0.10.9
  26. RUN mkdir -p /opt/open62541/pki/created
  27. RUN python /opt/open62541/tools/certs/create_self-signed.py /opt/open62541/pki/created
  28. EXPOSE 4840
  29. CMD ["/opt/open62541/build/bin/examples/server_ctt" , "/opt/open62541/pki/created/server_cert.der", "/opt/open62541/pki/created/server_key.der", "--enableUnencrypted", "--enableAnonymous"]