-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
83 lines (72 loc) · 2.24 KB
/
Dockerfile
File metadata and controls
83 lines (72 loc) · 2.24 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
79
80
81
82
83
FROM ubuntu:16.04
MAINTAINER Anton Kozlov <drakon.mega@gmail.com>
# Container utils
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \
sudo \
iptables \
openssh-server \
iproute2 \
bzip2 \
unzip \
xz-utils \
python \
curl \
make \
patch \
cpio \
gcc-multilib \
g++-multilib \
gdb \
qemu-system \
ruby \
bison \
flex \
bc \
autoconf \
pkg-config \
mtd-utils \
ntfs-3g \
autotools-dev \
automake \
xutils-dev \
libtool && \
apt-get clean && \
rm -rf /var/lib/apt /var/cache/apt
## arm crosscompiler
## NOTE use insecure connection (-k) to avoid troubles with outdated local certificates
## another option is to update certificates (i.e. from https://curl.haxx.se/docs/caextract.html) and provide the file with --cacert
RUN curl -k -L "https://developer.arm.com/-/media/Files/downloads/gnu-rm/6-2017q2/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2" | \
tar -jxC /opt
## aarch64 crosscompiler
RUN curl -k -L "https://developer.arm.com/-/media/Files/downloads/gnu-a/8.3-2019.03/binrel/gcc-arm-8.3-2019.03-x86_64-aarch64-elf.tar.xz" | \
tar -xJC /opt
## risc-v crosscompiler
RUN curl -k -L -s "https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.2.0-2019.05.3-x86_64-linux-ubuntu14.tar.gz" | \
tar -xzC /opt
## other crosscompilers
RUN for a in microblaze mips powerpc sparc; do \
curl -k -L "https://github.com/embox/crosstool/releases/download/2.42-13.2.0-14.2/$a-elf-toolchain.tar.bz2" | \
tar -jxC /opt; \
done
ENV PATH=$PATH:\
/opt/gcc-arm-none-eabi-6-2017-q2-update/bin:\
/opt/gcc-arm-8.3-2019.03-x86_64-aarch64-elf/bin:\
/opt/riscv64-unknown-elf-gcc-8.2.0-2019.05.3-x86_64-linux-ubuntu14/bin:\
/opt/microblaze-elf-toolchain/bin:\
/opt/mips-elf-toolchain/bin:\
/opt/powerpc-elf-toolchain/bin:\
/opt/sparc-elf-toolchain/bin
COPY create_matching_user.sh /usr/local/sbin/
COPY docker_start.sh /usr/local/sbin/
COPY id_rsa.pub /home/user/.ssh/authorized_keys
COPY user.bashrc /home/user/.bashrc
COPY user.bash_profile /home/user/.bash_profile
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
## x86/test/fs
RUN for i in $(seq 0 9); do \
mknod /dev/loop$i -m0660 b 7 $i; \
done
EXPOSE 22
VOLUME /embox
CMD ["/usr/local/sbin/docker_start.sh"]