-
Notifications
You must be signed in to change notification settings - Fork 378
/
Copy pathDockerfile
47 lines (36 loc) · 1.6 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
37
38
39
40
41
42
43
44
45
46
47
# Copyright (C) 2018 Curt Brune <curt@cumulusnetworks.com>
#
# Modified with permission from Benayak Karki
#
# SPDX-License-Identifier: GPL-2.0
FROM debian:9
RUN echo "deb [trusted=yes] http://archive.debian.org/debian stretch main non-free contrib" > /etc/apt/sources.list
RUN echo "deb-src [trusted=yes] http://archive.debian.org/debian stretch main non-free contrib" >> /etc/apt/sources.list
RUN echo "deb [trusted=yes] http://archive.debian.org/debian-security stretch/updates main non-free contrib" >> /etc/apt/sources.list
# Add initial development packages
RUN apt-get update && apt-get install -y \
build-essential stgit u-boot-tools util-linux \
gperf device-tree-compiler python-all-dev xorriso \
autoconf automake bison flex texinfo libtool libtool-bin \
realpath gawk libncurses5 libncurses5-dev bc \
dosfstools mtools pkg-config git wget help2man libexpat1 \
libexpat1-dev fakeroot python-sphinx rst2pdf \
libefivar-dev libnss3-tools libnss3-dev libpopt-dev \
libssl-dev sbsigntool uuid-runtime uuid-dev cpio \
bsdmainutils curl sudo unzip
# Create build user
RUN useradd -m -s /bin/bash build && \
adduser build sudo && \
echo "build:build" | chpasswd
WORKDIR /home/build
# Add /sbin and /usr/sbin to build user's path
RUN echo export PATH="/sbin:/usr/sbin:\$PATH" >> .bashrc
# Add common files, like .gitconfig
COPY home .
# Create /home/build/src as a mount point for sharing files with the
# host system.
RUN mkdir src
# Make sure everything in /home/build is owned by the build user
RUN chown -R build:build .
USER build
CMD ["/bin/bash", "--login"]