-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
82 lines (73 loc) · 2.81 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#
# This Dockerfile provides a reproducible development environment for
# developing applications for the Adapteva Parallella development board.
#
# See: http://www.parallella.org
#
FROM ubuntu:utopic
MAINTAINER Sarah Mount <[email protected]>
# Install prerequisites.
# Setup a new user 'dev' and add to sudoers.
RUN sudo apt-get update -qq && sudo apt-get -qq install -y build-essential \
bison \
flex \
g++-arm-linux-gnueabihf \
gcc-arm-linux-gnueabihf \
git \
libgmp3-dev \
libncurses5-dev \
libmpc-dev \
libmpfr-dev \
locate \
texinfo \
wget \
xzip \
lzip \
zip && \
adduser --quiet --shell /bin/bash --gecos "Epiphany Developer,101,," --disabled-password dev && \
adduser dev sudo && \
chown -R dev:dev /home/dev/ && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
mkdir -p /opt/adapteva && \
chown -R dev:dev /opt/adapteva && \
mkdir -p /home/dev/buildroot && \
chown -R dev:dev /home/dev/buildroot
# Set up new user and home directory in environment.
# Note that WORKDIR will not expand environment variables in docker versions < 1.3.1.
# See docker issue 2637: https://github.com/docker/docker/issues/2637
USER dev
ENV HOME /home/dev
ENV EPIPHANY_BUILD_HOME /home/dev/buildroot
# Download, build and install the Epiphany toolchain and SDK.
# Remove temporary files to save space.
# Download the official Epiphany examples repository into $HOME/examples.
WORKDIR /home/dev/buildroot
RUN wget --no-check-certificate https://github.com/adapteva/epiphany-sdk/archive/2015.1.zip && \
unzip 2015.1.zip && \
rm 2015.1.zip && \
mv epiphany-sdk-2015.1 sdk && \
sed -i.bak s/--clone/--download/g sdk/build-epiphany-sdk.sh && \
./sdk/build-epiphany-sdk.sh -C -R -a x86_64 && \
./sdk/build-epiphany-sdk.sh -C -R -a armv7l -c arm-linux-gnueabihf && \
cp -a esdk.2015.1/ /opt/adapteva/ && \
ln -s /opt/adapteva/esdk.2015.1 /opt/adapteva/esdk && \
rm /opt/adapteva/esdk/tools/e-gnu && \
ln -s /opt/adapteva/esdk/tools/e-gnu.x86_64 /opt/adapteva/esdk/tools/e-gnu && \
cd /home/dev/ && \
rm -Rf /home/dev/buildroot && \
wget --no-check-certificate https://github.com/adapteva/epiphany-examples/archive/master.zip && \
unzip master.zip && \
rm master.zip && \
mv epiphany-examples-master examples
# Set environment variables for the new toolchain.
ENV EPIPHANY_HOME /opt/adapteva/esdk
ENV PATH ${EPIPHANY_HOME}/tools/e-gnu/bin:${EPIPHANY_HOME}/tools/host/bin:${PATH}
ENV LD_LIBRARY_PATH ${EPIPHANY_HOME}/tools/host/lib:${LD_LIBRARY_PATH}
ENV EPIPHANY_HDF ${EPIPHANY_HOME}/bsps/current/platform.hdf
ENV MANPATH ${EPIPHANY_HOME}/tools/e-gnu/share/man:${MANPATH}
# Start at $HOME.
WORKDIR /home/dev
# Expose a port so that GDB can connect to a Parallella board.
EXPOSE 51000
# Start from a BASH shell.
CMD ["bash"]