-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
69 lines (58 loc) · 1.79 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
FROM ubuntu:20.04
RUN apt update -y
# Install tzdata without user input
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt -y install tzdata
# General packages
RUN apt install -y \
apt-utils \
build-essential \
automake \
make \
autogen \
bison \
flex \
libtool \
pkg-config \
build-essential \
bc \
bzip2 \
gzip \
tar \
xz-utils \
ca-certificates \
runit
# Split to avoid too many files error in build
RUN apt install -y \
bash \
python \
sed \
vim \
file \
git \
curl \
wget
# Cross-compiler and emulator
RUN dpkg --add-architecture armel
RUN apt install -y \
crossbuild-essential-armel \
g++-arm-linux-gnueabihf \
qemu-user \
qemu-user-static
# CMake to build pmacFilterControl
RUN apt install -y cmake
RUN mkdir /build && cd /build
# Build zeromq for ARM
RUN git clone https://github.com/zeromq/libzmq.git && cd libzmq && \
./autogen.sh && \
mkdir prefix && \
# http://wiki.zeromq.org/build:arm
./configure --host=arm-none-linux-gnueabihf CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ --prefix=/build/libzmq/prefix/ && \
make -j8 && make install
# The built files will be copied to PowerPMAC:/root/lib
# Link ARM toolchain libs to /root/lib inside the container to build in the same location
RUN ln -s /usr/arm-linux-gnueabihf/lib /root/lib && chmod o+rx /root && chmod -R o+r /root/lib
# Make sure we can find standard lib, zeromq and pmacFilterControl libs
ENV LD_LIBRARY_PATH=/root/lib:/build/libzmq/prefix/lib:/build/pmacFilterControl/arm_prefix/lib
WORKDIR /build
# Default command - Build and run hello world
CMD bash -c "cd /build/pmacFilterControl/docker && mkdir -p build && arm-linux-gnueabihf-g++ -o build/hello_arm hello.cpp && qemu-arm -L /root/ ./build/hello_arm"