Skip to content

Commit

Permalink
utils: docker: add files for using docker as building-environment
Browse files Browse the repository at this point in the history
  • Loading branch information
frank-w committed Sep 1, 2024
1 parent 36fa0ef commit 8a58c69
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
33 changes: 33 additions & 0 deletions utils/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions utils/docker/build_container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

DIR=$(dirname "$(readlink -f "$0")")

docker build "$DIR" --tag bpi-cross-compile:1
14 changes: 14 additions & 0 deletions utils/docker/run.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8a58c69

Please sign in to comment.