From 9ab73f47aedebd94eb4d353262a582d9fd3a8cec Mon Sep 17 00:00:00 2001 From: neonloop Date: Sun, 7 Mar 2021 14:47:57 +0000 Subject: Clear buildroot source after building This saves an enormous amount of disk space in the image. Since fewer packages are installed, there is a method for installing extra packages. This also adds a helper script for setting up common cross-compiling variables. --- Dockerfile | 34 ++++++++-------------------------- 1 file changed, 8 insertions(+), 26 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 7fb7e1e..a4a96b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,19 +3,14 @@ FROM ubuntu:16.04 RUN apt-get -y update \ && apt-get -y install \ bc \ - bison \ build-essential \ bzip2 \ - clang \ cpio \ curl \ g++ \ git \ - libboost-dev \ libncurses5-dev \ - libz-dev \ locales \ - libtool \ make \ patch \ perl \ @@ -23,51 +18,38 @@ RUN apt-get -y update \ unzip \ rsync \ wget \ - zip \ && rm -rf /var/lib/apt/lists/* - RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \ locale-gen ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 +ENV BUILDROOT_VERSION 2016.05 ENV BUILDROOT_HOST_DIR /var/lib/trimui-toolchain ENV BUILDROOT_SYSROOT ${BUILDROOT_HOST_DIR}/usr/arm-buildroot-linux-gnueabi/sysroot/ -ENV BR_VER 2016.05 -ENV BR_DIR buildroot-${BR_VER} -ENV BR_TAR ${BR_DIR}.tar.bz2 -ENV BR_URL https://buildroot.org/downloads/${BR_TAR} - - RUN useradd -d /home/trimui -m -s /bin/bash -U trimui RUN mkdir -p ${BUILDROOT_HOST_DIR} && \ chown -R trimui:trimui ${BUILDROOT_HOST_DIR} && \ ln -s ${BUILDROOT_HOST_DIR}/usr /opt/trimui-toolchain - USER trimui WORKDIR /home/trimui COPY trimui_config trimui_config +COPY build_toolchain.sh *.patch ./ +RUN ./build_toolchain.sh -RUN echo ${BR_DIR} && wget ${BR_URL} && ls -l && tar xf ${BR_TAR} && rm -f ${BR_TAR} -RUN ln -s ${BR_DIR} buildroot - -WORKDIR /home/trimui/buildroot -RUN make trimui_defconfig BR2_EXTERNAL=../trimui_config && make toolchain +COPY env-setup.sh . -COPY *.patch . -RUN for patch in *.patch; do patch -p0 < $patch; done -RUN make - - -WORKDIR /home/trimui +COPY extra_packages.txt . +USER root +RUN apt-get -y update && apt-get -y install $(cat extra_packages.txt) && rm -rf /var/lib/apt/lists/* +USER trimui COPY extras extras - RUN rsync -av extras/* $BUILDROOT_SYSROOT/usr/ VOLUME /home/trimui/workspace -- cgit v1.2.3