-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile.cross
More file actions
78 lines (71 loc) · 2.75 KB
/
Dockerfile.cross
File metadata and controls
78 lines (71 loc) · 2.75 KB
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
ARG DEBIAN_RELEASE=stretch
ARG ARCH=armel
FROM debian:$DEBIAN_RELEASE
ARG DEBIAN_RELEASE
ARG ARCH
# This is a customized version of ev3dev-stretch-cross image
# Setup repositories and install required packages
COPY sources.list.$DEBIAN_RELEASE /etc/apt/sources.list
COPY ev3dev-archive-keyring.gpg /etc/apt/trusted.gpg.d/
# Install native packages first
RUN dpkg --add-architecture $ARCH && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
ca-certificates wget curl less nano vim bash-completion tree sudo \
man-db cmake build-essential gdb-multiarch pkg-config qemu-user-static \
xz-utils zip pigz unzip cpio file make m4 gawk procps autoconf \
autoconf-archive automake autotools-dev mercurial git systemtap \
systemtap-sdt-dev zlib1g-dev gdb libarchive13 libbabeltrace-ctf1 \
libbabeltrace1 libcurl3 libcurl3-gnutls libdw1 libgnutls30 \
g++
# Install cross-compilation packages with ALL dependencies in one go
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
crossbuild-essential-$ARCH \
# X11 development libraries
libx11-dev:$ARCH \
libxext-dev:$ARCH \
libxrender-dev:$ARCH \
libxrandr-dev:$ARCH \
libxtst-dev:$ARCH \
libxt-dev:$ARCH \
# CUPS printing system
libcups2-dev:$ARCH \
libcups2:$ARCH \
libcupsimage2-dev:$ARCH \
# Font and graphics
libfreetype6-dev:$ARCH \
libfreetype6:$ARCH \
libfontconfig1-dev:$ARCH \
libfontconfig1:$ARCH \
libexpat1-dev:$ARCH \
# Multimedia
libasound2-dev:$ARCH \
# Compression and images
libffi-dev:$ARCH \
libpng-dev:$ARCH \
libpng16-16:$ARCH \
libjpeg-dev:$ARCH \
libgif-dev:$ARCH \
liblcms2-dev:$ARCH \
zlib1g-dev:$ARCH \
zlib1g:$ARCH \
# Essential C development for cross-compilation
libc6-dev:$ARCH \
linux-libc-dev:$ARCH \
build-essential \
g++
# Clean up
RUN rm -rf /var/lib/apt/lists/*
# Download and extract architecture-specific systemtap-sdt-dev
RUN ( if [ "$DEBIAN_RELEASE" = "stretch" ]; then \
wget http://archive.debian.org/debian/pool/main/s/systemtap/systemtap-sdt-dev_3.1-2_$ARCH.deb -O /tmp/systemtap.deb; \
elif [ "$DEBIAN_RELEASE" = "buster" ]; then \
wget http://archive.debian.org/debian/pool/main/s/systemtap/systemtap-sdt-dev_4.0-1_$ARCH.deb -O /tmp/systemtap.deb; \
fi ) && \
dpkg-deb -x /tmp/systemtap.deb / && \
rm -rf /tmp/systemtap.deb
# Prepare a nonroot user
COPY compiler.sudoers /etc/sudoers.d/compiler
RUN chmod 0440 /etc/sudoers.d/compiler && \
adduser --disabled-password --gecos "" compiler && \
usermod -a -G sudo compiler