1
0
mirror of https://github.com/cusspvz/openwrt-builder.docker.git synced 2026-08-18 03:43:00 +00:00

Initial commit

This commit is contained in:
José Moreira
2018-09-08 17:22:54 +01:00
commit c03c962f6f
11 changed files with 321 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
FROM debian:8
LABEL MAINTAINER "Jose Moreira <josemoreiravarzim@gmail.com>"
RUN echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list \
&& apt-get update \
&& apt-get -t jessie-backports install "gosu" \
&& apt-get install -y --no-install-recommends \
ca-certificates wget curl rsync \
git subversion \
build-essential g++ \
python time unzip file gawk ccache gettext xsltproc \
libssl-dev libncurses5-dev zlib1g-dev \
&& apt-get autoclean \
&& apt-get clean \
&& apt-get autoremove \
&& rm -rf /var/lib/apt/lists/*
ADD etc/entrypoint.sh /entrypoint
RUN chmod 755 /entrypoint
RUN mkdir -p /src /output
WORKDIR /src
ENTRYPOINT ["/entrypoint"]
CMD ["/bin/bash"]
+17
View File
@@ -0,0 +1,17 @@
#!/bin/sh
chown -R $GOSU_USER /lede
# If GOSU_USER environment variable set to something other than 0:0 (root:root),
# become user:group set within and exec command passed in args
if [ "$GOSU_USER" != "0:0" ]; then
# make sure a valid user exists in /etc/passwd
if grep "^builder:" /etc/passwd; then
sed -i "/^builder:/d" /etc/passwd
fi
echo "builder:x:$GOSU_USER:LEDE builder:/lede:/bin/bash" >> /etc/passwd
exec gosu $GOSU_USER "$@"
fi
# If GOSU_USER was 0:0 exec command passed in args without gosu (assume already root)
exec "$@"