-
Notifications
You must be signed in to change notification settings - Fork 47
/
Dockerfile
40 lines (28 loc) · 1.36 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
FROM ubuntu:16.04
RUN apt-get update && apt-get upgrade -y && apt-get clean
RUN apt-get update && apt-get install -y python-setuptools python-wheel
RUN apt-get install -y gcc g++ curl wget unzip git pkg-config libssl-dev libssh2-1-dev cmake\
&& apt-get clean
# Add user jenkins to the image
RUN adduser --quiet --home /build/ build
RUN git clone https://github.com/raspberrypi/tools /opt/pitools --depth 1
USER build
WORKDIR /build
#install rust
RUN HOME=/build curl https://sh.rustup.rs -sSf | HOME=/build sh -s -- -y
#setup path with cargo & protoc
RUN echo 'PATH=/build/.cargo/bin:$PATH' >> /build/.bashrc
RUN /build/.cargo/bin/cargo install dinghy
RUN /build/.cargo/bin/rustup target install armv7-unknown-linux-gnueabihf \
&& /build/.cargo/bin/rustup target install arm-unknown-linux-gnueabihf
RUN echo '[target.arm-unknown-linux-gnueabihf]\n\
linker = "/opt/pitools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc"\n\
\n\
[target.armv7-unknown-linux-gnueabihf]\n\
linker = "/opt/pitools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc"\n\
'>> /build/.cargo/config
RUN echo 'export TARGET_CC=/opt/pitools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc' >> /build/.bashrc
RUN ln -s /pypirc /build/.pypirc
RUN ln -s /dinghy.toml /build/.dinghy.toml
RUN ln -s /ssh-conf /build/.ssh
WORKDIR /build/workdir