-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (29 loc) · 1.21 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM debian:stretch-slim
RUN echo 'path-exclude /usr/share/doc/*\
path-include /usr/share/doc/*/copyright\
path-exclude /usr/share/man/*\
path-exclude /usr/share/groff/*\
path-exclude /usr/share/info/*\
path-exclude /usr/share/lintian/*\
path-exclude /usr/share/linda/*' > /etc/dpkg/dpkg.cfg.d/01_nodoc
RUN apt-get update && \
apt-get install -y subversion g++ zlib1g-dev build-essential git python rsync man-db && \
apt-get install -y libncurses5-dev gawk gettext unzip file libssl-dev wget zip time && \
apt-get clean
RUN useradd -m openwrt
# The `platform` build-arg is required when building an image using this
# Dockerfile. It must be one of the supported devices or platforms, as
# accepted by the Makefile in the working directory of the container.
ARG platform
# Set an environment variable so that the platform name can be known after
# the image is built.
ENV BUILD_PLATFORM=${platform}
WORKDIR /builder
COPY . .
RUN chown -R openwrt: .
USER openwrt
# First stage is to build the appropriate toolchain for the given platform.
RUN make ${BUILD_PLATFORM}.toolchain
# Once the image is built, running it in a docker image will build the
# appropriate firmwares and .ipk packages.
CMD make ${BUILD_PLATFORM}