-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile.cross
46 lines (35 loc) · 1.31 KB
/
Dockerfile.cross
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
FROM debian:9 as builder
# Install dependencies
RUN apt-get update && \
apt-get install -y make gcc g++ flex bison git rsync \
autoconf texinfo help2man libtool libncurses5-dev \
bzip2 xz-utils unzip gawk libtool-bin wget python3 \
python3-pip curl
RUN pip3 install pytest
RUN groupadd -r builduser && \
useradd -rm -g builduser builduser
USER builduser
# Create cache folder for crosstool-ng
RUN mkdir /home/builduser/src
ENV CT_NG_SRC=/home/builduser/src/crosstool-ng-1.24.0/
ENV CIF_SRC=/home/builduser/src/cif/
# Install crosstool-ng
WORKDIR /home/builduser/src
RUN wget http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.24.0.tar.xz
RUN tar -xf crosstool-ng-1.24.0.tar.xz
# Build and install crosstool-ng
WORKDIR $CT_NG_SRC
RUN ./configure --enable-local
RUN make
# Copy CIF source code
COPY --chown=builduser:builduser cif.cpp Makefile $CIF_SRC
COPY --chown=builduser:builduser aspectator $CIF_SRC/aspectator
COPY --chown=builduser:builduser .git $CIF_SRC/.git
COPY --chown=builduser:builduser tests $CIF_SRC/tests
# Copy configuration for crosstool-ng and build.py script
COPY --chown=builduser:builduser config $CIF_SRC/config
COPY --chown=builduser:builduser build.py $CIF_SRC
# Download prerequisites
WORKDIR $CIF_SRC/aspectator
RUN ./contrib/download_prerequisites
WORKDIR $CIF_SRC