-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathDockerfile
59 lines (51 loc) · 1.9 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
57
58
59
FROM debian:jessie
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y apt-utils \
&& DEBIAN_FRONTEND=noninteractive dpkg-reconfigure apt-utils \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
automake \
cmake \
curl \
fakeroot \
g++ \
git \
make \
runit \
sudo \
xz-utils
# Here is where we hardcode the toolchain decision.
ENV HOST=arm-linux-gnueabihf \
TOOLCHAIN=gcc-linaro-arm-linux-gnueabihf-raspbian-x64 \
RPXC_ROOT=/rpxc
# TOOLCHAIN=arm-rpi-4.9.3-linux-gnueabihf \
# TOOLCHAIN=gcc-linaro-arm-linux-gnueabihf-raspbian-x64 \
WORKDIR $RPXC_ROOT
RUN curl -L https://github.com/raspberrypi/tools/tarball/master \
| tar --wildcards --strip-components 3 -xzf - "*/arm-bcm2708/$TOOLCHAIN/"
ENV ARCH=arm \
CROSS_COMPILE=$RPXC_ROOT/bin/$HOST- \
PATH=$RPXC_ROOT/bin:$PATH \
QEMU_PATH=/usr/bin/qemu-arm-static \
QEMU_EXECVE=1 \
SYSROOT=$RPXC_ROOT/sysroot
WORKDIR $SYSROOT
RUN curl -Ls https://github.com/sdhibit/docker-rpi-raspbian/raw/master/raspbian.2015.05.05.tar.xz \
| tar -xJf - \
&& curl -Ls https://github.com/resin-io-projects/armv7hf-debian-qemu/raw/master/bin/qemu-arm-static \
> $SYSROOT/$QEMU_PATH \
&& chmod +x $SYSROOT/$QEMU_PATH \
&& mkdir -p $SYSROOT/build \
&& chroot $SYSROOT $QEMU_PATH /bin/sh -c '\
echo "deb http://archive.raspbian.org/raspbian jessie firmware" \
>> /etc/apt/sources.list \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y apt-utils \
&& DEBIAN_FRONTEND=noninteractive dpkg-reconfigure apt-utils \
&& DEBIAN_FRONTEND=noninteractive apt-get upgrade -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
libc6-dev \
symlinks \
&& symlinks -cors /'
COPY image/ /
WORKDIR /build
ENTRYPOINT [ "/rpxc/entrypoint.sh" ]