Skip to content

Commit 89ff036

Browse files
committed
utils: docker: add files for using docker as building-environment
1 parent 0ec8cd5 commit 89ff036

3 files changed

Lines changed: 52 additions & 0 deletions

File tree

utils/docker/Dockerfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
FROM ubuntu:noble
2+
3+
RUN apt-get update \
4+
&& apt-get -y -q upgrade \
5+
&& apt-get -y -q install \
6+
bc \
7+
bison \
8+
build-essential \
9+
ccache \
10+
flex \
11+
gcc-arm-linux-gnueabihf \
12+
gcc-aarch64-linux-gnu \
13+
git \
14+
libc6-armhf-cross \
15+
libncurses-dev \
16+
libssl-dev \
17+
make \
18+
u-boot-tools \
19+
wget \
20+
xz-utils \
21+
libncurses-dev \
22+
nano \
23+
sudo \
24+
kmod \
25+
debhelper rsync cpio \
26+
&& apt-get clean
27+
28+
RUN usermod -aG sudo ubuntu && \
29+
echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
30+
31+
RUN mkdir -p /srv/code && chmod a+rwx -R /srv
32+
33+
WORKDIR /srv/code

utils/docker/build_container.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
DIR=$(dirname "$(readlink -f "$0")")
4+
5+
docker build "$DIR" --tag bpi-cross-compile:1

utils/docker/run.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh
2+
3+
DIR=$(dirname "$(readlink -f "$0")")
4+
REPO_DIR="$DIR/../.."
5+
6+
export UID=$(id -u)
7+
export GID=$(id -g)
8+
9+
mkdir -p "$REPO_DIR/SD"
10+
docker run --privileged -it \
11+
--user $UID:$GID \
12+
-v "$REPO_DIR/SD":/srv/SD \
13+
-v "$REPO_DIR":/srv/code \
14+
bpi-cross-compile:1 /bin/bash

0 commit comments

Comments
 (0)