diff --git a/utils/docker/Dockerfile b/utils/docker/Dockerfile new file mode 100644 index 000000000000..62b964e4ac4f --- /dev/null +++ b/utils/docker/Dockerfile @@ -0,0 +1,33 @@ +FROM ubuntu:noble + +RUN apt-get update \ + && apt-get -y -q upgrade \ + && apt-get -y -q install \ + bc \ + bison \ + build-essential \ + ccache \ + flex \ + gcc-arm-linux-gnueabihf \ + gcc-aarch64-linux-gnu \ + git \ + libc6-armhf-cross \ + libncurses-dev \ + libssl-dev \ + make \ + u-boot-tools \ + wget \ + xz-utils \ + libncurses-dev \ + nano \ + sudo \ + kmod \ + debhelper rsync cpio \ + && apt-get clean + +RUN usermod -aG sudo ubuntu && \ + echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +RUN mkdir -p /srv/code && chmod a+rwx -R /srv + +WORKDIR /srv/code diff --git a/utils/docker/build_container.sh b/utils/docker/build_container.sh new file mode 100755 index 000000000000..e47cda1f287a --- /dev/null +++ b/utils/docker/build_container.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +DIR=$(dirname "$(readlink -f "$0")") + +docker build "$DIR" --tag bpi-cross-compile:1 diff --git a/utils/docker/run.sh b/utils/docker/run.sh new file mode 100755 index 000000000000..d7f819eeaf41 --- /dev/null +++ b/utils/docker/run.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +DIR=$(dirname "$(readlink -f "$0")") +REPO_DIR="$DIR/../.." + +export UID=$(id -u) +export GID=$(id -g) + +mkdir -p "$REPO_DIR/SD" +docker run --privileged -it \ + --user $UID:$GID \ + -v "$REPO_DIR/SD":/srv/SD \ + -v "$REPO_DIR":/srv/code \ + bpi-cross-compile:1 /bin/bash