Dockerfile 1.1 KB

123456789101112131415161718192021222324252627282930
  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. WORKDIR /opt/open62541
  5. RUN git submodule update --init --recursive
  6. WORKDIR /opt/open62541/build
  7. RUN cmake -DBUILD_SHARED_LIBS=ON \
  8. -DCMAKE_BUILD_TYPE=Debug \
  9. -DUA_BUILD_EXAMPLES=ON \
  10. # Hardening needs to be disabled, otherwise the docker build takes too long and travis fails
  11. -DUA_ENABLE_HARDENING=OFF \
  12. -DUA_ENABLE_ENCRYPTION=ON \
  13. -DUA_ENABLE_SUBSCRIPTIONS=ON \
  14. -DUA_ENABLE_SUBSCRIPTIONS_EVENTS=ON \
  15. -DUA_NAMESPACE_ZERO=FULL \
  16. /opt/open62541
  17. RUN make -j
  18. RUN make install
  19. # Generate certificates
  20. RUN apk add --no-cache python-dev linux-headers openssl && rm -rf /var/cache/apk/*
  21. RUN pip install netifaces==0.10.9
  22. RUN mkdir -p /opt/open62541/pki/created
  23. RUN python /opt/open62541/tools/certs/create_self-signed.py /opt/open62541/pki/created
  24. WORKDIR /opt/open62541
  25. EXPOSE 4840
  26. CMD ["/opt/open62541/build/bin/examples/server_ctt" , "/opt/open62541/pki/created/server_cert.der", "/opt/open62541/pki/created/server_key.der", "--enableUnencrypted", "--enableAnonymous"]