-
Notifications
You must be signed in to change notification settings - Fork 462
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create Base and docker file for EdgeHub. (#922)
- Loading branch information
1 parent
b3a6328
commit 4fdfa40
Showing
2 changed files
with
40 additions
and
0 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
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 |
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,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 |