Skip to content

Commit

Permalink
Create Base and docker file for EdgeHub. (#922)
Browse files Browse the repository at this point in the history
  • Loading branch information
aribeironovaes authored Mar 5, 2019
1 parent b3a6328 commit 4fdfa40
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
19 changes: 19 additions & 0 deletions edge-hub/docker/linux/arm64v8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ARG base_tag=1.0.0-preview010-linux-arm64v8
FROM azureiotedge/azureiotedge-hub-base:${base_tag}

ARG EXE_DIR=.

WORKDIR /app

COPY $EXE_DIR/ ./

# Expose MQTT, AMQP and HTTPS ports
EXPOSE 8883/tcp
EXPOSE 5671/tcp
EXPOSE 443/tcp

USER edgehubuser
ENV OptimizeForPerformance false
ENV MqttEventsProcessorThreadCount 1
CMD echo "$(date --utc +"[%Y-%m-%d %H:%M:%S %:z]"): Starting Edge Hub" && \
exec /usr/bin/dotnet Microsoft.Azure.Devices.Edge.Hub.Service.dll
21 changes: 21 additions & 0 deletions edge-hub/docker/linux/arm64v8/base/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ARG base_tag=3.0-runtime-bionic-arm64v8

FROM microsoft/dotnet:${base_tag}

# Add an unprivileged user account for running Edge Hub
RUN useradd -ms /bin/bash edgehubuser
ENV EdgeHubUser=edgehubuser

RUN apt-get update && \
apt-get install -y libsnappy1v5 && \
rm -rf /var/lib/apt/lists/* && \
ln -s /lib/aarch64-linux-gnu/libdl.so.2 /usr/lib/aarch64-linux-gnu/libdl.so.2 && \
ln -s /lib/aarch64-linux-gnu/libdl.so.2 /lib/aarch64-linux-gnu/libdl.so && \
ln -s /lib/aarch64-linux-gnu/libdl.so.2 /usr/lib/aarch64-linux-gnu/libdl.so && \
ln -s /lib/aarch64-linux-gnu/libc.so.6 /usr/lib/aarch64-linux-gnu/libc.so.6

COPY librocksdb.so /usr/lib

# add the CAP_NET_BIND_SERVICE capability to the dotnet binary because
# we are starting edge hub as a non-root user
RUN setcap 'cap_net_bind_service=+ep' /usr/share/dotnet/dotnet

0 comments on commit 4fdfa40

Please sign in to comment.