-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
56 lines (42 loc) · 1.66 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FROM aziotbld/raspberrypi-c:latest
LABEL maintainer "[email protected]"
RUN apt-get update
#### Install .NET Core dependencies
RUN apt-get install -y \
libunwind8 \
libunwind8-dev \
gettext \
libicu-dev \
liblttng-ust-dev \
libcurl4-openssl-dev \
libssl-dev \
uuid-dev \
apt-transport-https \
wget
#### Install .NET Core 2.0.0
RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg \
&& mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg \
&& sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
RUN apt-get update
RUN apt-get install -y dotnet-sdk-2.0.0
#### Git clone IoT Edge repo
RUN git clone https://github.com/Azure/iot-edge.git /iot-edge
#### Update csproj files to target .NET Core 2.0.0
RUN cd / \
&& wget "https://scrapyard.blob.core.windows.net/share/iot-edge.tar.gz" \
&& tar -xzf iot-edge.tar.gz \
&& rm -f iot-edge.tar.gz \
&& chmod +x /iot-edge/tools/build_dotnet_core.sh
#### Get RPi toolchain
RUN chmod +x /iot-edge/jenkins/raspberrypi_c.sh
#### Create a symbolic link to the RPiTools in /home/jenkins because the script expects these tools in the root directory
RUN ln -sd /home/jenkins/RPiTools/ /root/RPiTools
RUN /iot-edge/jenkins/raspberrypi_c.sh
RUN cd /iot-edge \
&& ./tools/build.sh \
--enable-dotnet-core-binding \
--disable-native-remote-modules \
--toolchain-file ./toolchain-rpi.cmake
#### Create IoT Edge for RPi tarball so that it is easy to copy the file from the Docker container to the host
RUN tar -czf /iot-edge-rpi.tar.gz /iot-edge
CMD ["/bin/bash"]