docker: add docker image for building

arm-sdk7
Johan Källström 5 years ago
parent 6db0b29c98
commit 175bc9c8ed

@ -0,0 +1,83 @@
FROM debian:10
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install --no-install-suggests --no-install-recommends -y \
apt-utils \
libnss-wrapper \
&& apt-get install --no-install-suggests --no-install-recommends -y \
build-essential \
net-tools \
autoconf \
m4 \
bison \
flex \
g++ \
libtool \
sqlite \
gcc \
binutils \
patch \
bzip2 \
make \
gettext \
unzip \
zlib1g-dev \
libc6 \
gperf \
automake \
groff \
lib32stdc++6 \
libncurses5 \
libncurses5-dev \
gawk \
gitk \
zlib1g-dev \
autopoint \
shtool \
autogen \
mtd-utils \
gcc-multilib \
gconf-editor \
lib32z1-dev \
pkg-config \
libssl-dev \
automake1.11 \
libmnl-dev \
libxml2-dev \
intltool \
libglib2.0-dev \
libstdc++5 \
texinfo \
dos2unix \
xsltproc \
libnfnetlink0 \
libcurl4-openssl-dev \
libgtk2.0-dev \
libnotify-dev \
libevent-dev \
git \
re2c \
texlive \
libelf1 \
nodejs \
zip \
mc \
cmake \
curl \
linux-headers-4.19.0-9-all \
&& dpkg --add-architecture i386 \
&& apt-get update \
&& apt-get install --no-install-suggests --no-install-recommends -y \
libelf1:i386 \
libelf-dev:i386 \
&& apt-get remove -y 'libicu-dev*' 'uuid-dev*' \
&& rm -rf /var/lib/apt/lists/*
COPY nss_wrapper /usr/bin/
# Map user and dont run as root
USER 65534
ENTRYPOINT ["nss_wrapper"]
CMD ["bash"]

@ -0,0 +1,21 @@
VERSION ?= latest
DOCKER ?= docker
IMG_NAME ?= freshtomato
build_freshtomato: .freshtomato.docker_built
.freshtomato.docker_built: Dockerfile nss_wrapper
$(DOCKER) build -t $(IMG_NAME):$(VERSION) .
touch .freshtomato.docker_built
run_freshtomato: .freshtomato.docker_built
$(DOCKER) run -v $(abspath ../):/ws -it --user $(shell id -u):$(shell id -g) $(IMG_NAME):$(VERSION) /bin/bash
build.%: .freshtomato.docker_built
$(DOCKER) run -v $(abspath ../):/ws -it --user $(shell id -u):$(shell id -g) $(IMG_NAME):$(VERSION) make -C /ws/release/src-rt-6.x.4708 $(subst build.,,$@)
clean:
rm -f .freshtomato.docker_built
help:
@make -s -C ../release/src-rt-6.x.4708 help | sed 's,^[a-z],build.&,g'

@ -0,0 +1,22 @@
#!/bin/bash
# Set current user in nss_wrapper
USER_ID=$(id -u)
GROUP_ID=$(id -g)
if [ x"$USER_ID" != x"0" ]; then
NSS_WRAPPER_PASSWD=/tmp/passwd
NSS_WRAPPER_GROUP=/etc/group
cat /etc/passwd > $NSS_WRAPPER_PASSWD
echo "default:x:${USER_ID}:${GROUP_ID}:Default Build User:${HOME}:/bin/bash" >> $NSS_WRAPPER_PASSWD
export NSS_WRAPPER_PASSWD
export NSS_WRAPPER_GROUP
export LD_PRELOAD=libnss_wrapper.so
fi
exec "$@"
Loading…
Cancel
Save