mirror of
https://github.com/rafacouto/docker-openwrt-builder
synced 2025-06-08 08:26:21 +00:00
Dockerfile and build script.
This commit is contained in:
parent
0a79940942
commit
97d29e4b07
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
FROM debian:jessie
|
||||||
|
|
||||||
|
MAINTAINER Rafa Couto <caligari@treboada.net>
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get -y install \
|
||||||
|
git-core build-essential libssl-dev libncurses5-dev unzip \
|
||||||
|
gawk subversion mercurial wget gettext \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
ENV OPENWRT_RELEASE=v15.05.1 \
|
||||||
|
OPENWRT_TARGET=rpi3 \
|
||||||
|
WORKDIR=/usr/src/openwrt
|
||||||
|
|
||||||
|
ADD config $WORKDIR/target-configs
|
||||||
|
ADD scripts/* $WORKDIR/docker-scripts
|
||||||
|
|
||||||
|
RUN git clone --branch $OPENWRT_RELEASE \
|
||||||
|
https://github.com/openwrt/openwrt.git $WORKDIR
|
||||||
|
|
||||||
|
WORKDIR $WORKDIR
|
||||||
|
|
||||||
|
CMD ["$WORKDIR/docker-scripts/build.sh", "$OPENWRT_TARGET"]
|
||||||
|
|
||||||
|
|
11
scripts/build.sh
Executable file
11
scripts/build.sh
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cp "$WORKDIR/target-configs/$OPENWRT_TARGET.diff" \
|
||||||
|
"$WORKDIR/.config" && exit 1
|
||||||
|
|
||||||
|
./scripts/feeds update -a && exit 1
|
||||||
|
./scripts/feeds install -a && exit 1
|
||||||
|
|
||||||
|
PROCESSORS=$(cat /proc/cpuinfo | grep '^processor' | wc -l)
|
||||||
|
ionice -c 3 nice -n19 make -j $((PROCESSORS - 1))
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user