rust-raspberrypi-OS-tutorials/docker/rustembedded-osdev-utils/Dockerfile

90 lines
4.0 KiB
Docker
Raw Normal View History

2019-11-25 18:54:05 +00:00
## SPDX-License-Identifier: MIT OR Apache-2.0
##
2021-01-01 10:28:32 +00:00
## Copyright (c) 2017-2021 Andre Richter <andre.o.richter@gmail.com>
## Copyright (c) 2019-2021 Nao Taco <naotaco@gmail.com>
2020-10-28 11:40:45 +00:00
FROM ubuntu:20.04
2019-03-07 18:29:23 +00:00
2019-12-25 17:32:52 +00:00
ARG VCS_REF
LABEL org.label-schema.vcs-ref=$VCS_REF \
2020-04-11 10:38:49 +00:00
org.label-schema.vcs-url="https://github.com/rust-embedded/rust-raspberrypi-OS-tutorials"
2019-12-25 17:32:52 +00:00
2019-09-20 13:11:22 +00:00
LABEL maintainer="The resources team <resources@teams.rust-embedded.org>, Andre Richter <andre.o.richter@gmail.com>"
2019-03-07 18:29:23 +00:00
# Ruby gems
COPY Gemfile .
RUN set -ex; \
tempPkgs=' \
automake \
bison \
build-essential \
flex \
git \
libtool \
pkg-config \
wget \
'; \
apt-get update; \
apt-get install -q -y --no-install-recommends \
$tempPkgs \
2019-10-27 21:13:20 +00:00
# persistent packages
ca-certificates \
gdb-multiarch \
libpixman-1-dev \
libglib2.0-dev \
libusb-1.0.0-dev \
locales \
python3 \
ruby \
ruby-dev \
; \
# Ruby dependencies
gem install bundler; \
bundle install --retry 3 --without development; \
2019-10-27 21:13:20 +00:00
# QEMU
2019-10-27 23:51:09 +00:00
git clone git://git.qemu.org/qemu.git; \
2019-10-27 21:13:20 +00:00
cd qemu; \
2020-10-28 11:40:45 +00:00
git checkout tags/v5.1.0; \
2019-10-27 21:13:20 +00:00
./configure --target-list=aarch64-softmmu --enable-modules \
--enable-tcg-interpreter --enable-debug-tcg \
--python=/usr/bin/python3; \
2020-04-16 21:13:17 +00:00
make -j8; \
2019-10-27 21:13:20 +00:00
make install; \
cd ..; \
rm -rf qemu; \
# Openocd
git clone --depth 1 https://git.code.sf.net/p/openocd/code openocd; \
cd openocd; \
./bootstrap; \
./configure --enable-ftdi; \
2020-04-16 21:13:17 +00:00
make -j8; \
2019-10-27 21:13:20 +00:00
make install; \
# GDB
wget -P ~ git.io/.gdbinit; \
# GCC AArch64 tools
wget https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-9.2-2019.12-x86_64-aarch64-none-elf.tar.xz; \
tar -xf gcc-arm-9*; \
cp gcc-arm-9*/bin/aarch64-none-elf-objdump gcc-arm-9*/bin/aarch64-none-elf-nm /usr/local/bin/; \
rm -rf gcc-arm-9*; \
2019-03-07 18:29:23 +00:00
# Cleanup
apt-get purge -y --auto-remove $tempPkgs; \
apt-get autoremove -q -y; \
apt-get clean -q -y; \
2019-03-07 18:29:23 +00:00
rm -rf /var/lib/apt/lists/*
2019-10-27 21:13:20 +00:00
# Locales
2019-03-07 18:29:23 +00:00
RUN locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US:en \
2020-10-28 11:40:45 +00:00
LC_ALL=en_US.UTF-8 \
RUBYOPT=-W0
2019-03-07 18:29:23 +00:00
2019-10-27 21:13:20 +00:00
# Openocd
COPY rpi3.cfg /openocd/
COPY rpi4.cfg /openocd/
2019-03-07 18:29:23 +00:00
2019-10-27 21:13:20 +00:00
# GDB
COPY auto /root/.gdbinit.d/auto