forked from armbian/build
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
125 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
### output directories | ||
.tmp/ | ||
output/ | ||
cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,17 @@ | ||
FROM ubuntu:16.04 | ||
RUN apt-get update | ||
RUN apt-get install -y git build-essential binutils | ||
WORKDIR /root | ||
RUN git clone https://github.com/igorpecovnik/lib/ | ||
RUN cp lib/compile.sh . | ||
RUN dpkg --add-architecture i386 | ||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y git dialog lsb-release binutils wget ca-certificates device-tree-compiler \ | ||
pv bc lzop zip binfmt-support build-essential ccache debootstrap ntpdate gawk gcc-arm-linux-gnueabihf gcc-arm-linux-gnueabi \ | ||
qemu-user-static u-boot-tools uuid-dev zlib1g-dev unzip libusb-1.0-0-dev ntpdate parted pkg-config libncurses5-dev whiptail \ | ||
debian-keyring debian-archive-keyring f2fs-tools libfile-fcntllock-perl rsync libssl-dev nfs-kernel-server btrfs-tools \ | ||
gcc-aarch64-linux-gnu ncurses-term p7zip-full dos2unix dosfstools libc6-dev-armhf-cross libc6-dev-armel-cross libc6-dev-arm64-cross \ | ||
curl gcc-arm-none-eabi libnewlib-arm-none-eabi patchutils python liblz4-tool libpython2.7-dev linux-base swig libpython-dev \ | ||
systemd-container udev distcc libstdc++-arm-none-eabi-newlib gcc-4.9-arm-linux-gnueabihf gcc-4.9-aarch64-linux-gnu \ | ||
g++-4.9-arm-linux-gnueabihf g++-4.9-aarch64-linux-gnu g++-5-aarch64-linux-gnu g++-5-arm-linux-gnueabihf lib32stdc++6 \ | ||
libc6-i386 lib32ncurses5 lib32tinfo5 locales ncurses-base zlib1g:i386 aptly | ||
RUN locale-gen en_US.UTF-8 | ||
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' TERM=screen | ||
WORKDIR /root/armbian | ||
COPY . /root/armbian | ||
ENTRYPOINT [ "/bin/bash", "/root/armbian/compile.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# DO NOT EDIT THIS FILE | ||
# | ||
# This is a Docker launcher file. To set up the configuration, use command line arguments to compile.sh | ||
# or create a config file named "config-docker-guest.conf" based on config-example.conf | ||
|
||
[[ ! -c /dev/loop-control ]] && display_alert "/dev/loop-control does not exist, image building may not work" "" "wrn" | ||
|
||
# remove "docker" from the command line since "docker-guest" will be passed instead | ||
shift | ||
|
||
# build a new container based on provided Dockerfile | ||
display_alert "Building a Docker container" | ||
docker build -t armbian . | ||
|
||
DOCKER_FLAGS=() | ||
|
||
# Running this container in privileged mode is a simple way to solve loop device access issues | ||
#DOCKER_FLAGS+=(--privileged) | ||
|
||
# add only required capabilities instead (though MKNOD should be already present) | ||
DOCKER_FLAGS+=(--cap-add=SYS_ADMIN --cap-add=MKNOD) | ||
|
||
# mounting things inside the container on Ubuntu won't work without this | ||
# https://github.com/moby/moby/issues/16429#issuecomment-217126586 | ||
DOCKER_FLAGS+=(--security-opt=apparmor:unconfined) | ||
|
||
# remove resulting container after exit | ||
DOCKER_FLAGS+=(--rm) | ||
|
||
# pass through loop devices | ||
for d in /dev/loop*; do | ||
DOCKER_FLAGS+=(--device=$d) | ||
done | ||
|
||
# accessing dynamically created devices won't work by default | ||
# and --device doesn't accept devices that don't exist at the time "docker run" is executed | ||
# https://github.com/moby/moby/issues/27886 | ||
# --device-cgroup-rule requires new Docker version | ||
|
||
# allow loop devices (not required) | ||
DOCKER_FLAGS+=(--device-cgroup-rule='b 7:* rmw') | ||
# allow loop device partitions | ||
DOCKER_FLAGS+=(--device-cgroup-rule='b 259:* rmw') | ||
|
||
# this is an ugly hack, but it is required to get /dev/loopXpY minor number | ||
# for mknod inside the container, and container itself still uses private /dev internally | ||
DOCKER_FLAGS+=(-v /dev:/tmp/dev:ro) | ||
|
||
# mount 2 named volumes - for cacheable data and compiler cache | ||
DOCKER_FLAGS+=(-v=armbian-cache:/root/armbian/cache -v=armbian-ccache:/root/.ccache) | ||
|
||
# mount 2 local directories - output and userpatches | ||
DOCKER_FLAGS+=(-v=$SRC/output:/root/armbian/output -v=$SRC/userpatches:/root/armbian/userpatches) | ||
|
||
# pass other command line arguments like KERNEL_ONLY=yes, KERNEL_CONFIGURE=yes, etc. | ||
# pass "docker-guest" as an additional config name that will be sourced in the container if exists | ||
display_alert "Running the container" | ||
docker run "${DOCKER_FLAGS[@]}" -it armbian docker-guest "$@" | ||
|
||
STATUS=$? | ||
|
||
if [[ $STATUS -ge 125 && $STATUS -le 127 ]]; then | ||
display_alert "Docker error" "$STATUS" "wrn" | ||
display_alert "please make sure you are using the latest version (17.06 CE or newer)" "" "wrn" | ||
display_alert "please check the Armbian documentation for the Docker setup procedure" "" "wrn" | ||
fi | ||
|
||
# don't need to proceed further on the host | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters