-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
executable file
·87 lines (72 loc) · 2.4 KB
/
Dockerfile
File metadata and controls
executable file
·87 lines (72 loc) · 2.4 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#
# docker-linux-kernel-builder
# Copyright (C) 2022 0xor0ne
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>.
From debian:stable-slim@sha256:1086096bcb743c4d04ad1edc0fe729fe536442049d76894172c8ed1fdbb4a48b
LABEL description="Container with everything needed to cross-compile the linux kernel"
ARG user=lkb
ARG root_password=password
ARG workspace_dir=workspace
ARG tc_dir=/home/lkb/workspace/tc
# Setup environment
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -y
RUN apt-get install -y --no-install-recommends \
build-essential \
ncurses-dev \
kmod \
jfsutils \
reiserfsprogs \
xfsprogs \
pcmciautils \
quota \
ppp \
libgmp-dev \
libmpc-dev \
btrfs-progs \
squashfs-tools \
bc \
git \
flex \
bison \
locales \
libssl-dev \
vim \
rsync \
sudo
# Enable UTF-8 locale
RUN sed -i 's/# \(en_US.UTF-8\)/\1/' /etc/locale.gen && \
/usr/sbin/locale-gen
# Set root password
RUN echo "root:${root_password}" | chpasswd
# Add user
RUN useradd -ms /bin/bash ${user} && \
chown -R ${user}:${user} /home/${user}
RUN echo "${user} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
COPY ./scripts/lkbuilder_entrypoint.sh /usr/local/bin
COPY ./scripts/lkbuilder_make.sh /usr/local/bin
COPY ./scripts/lkbuilder_olddefconfig.sh /usr/local/bin
COPY ./scripts/lkbuilder_transfer_artifacts.sh /usr/local/bin
RUN chown -R ${user}:${user} /usr/local/bin/lkbuilder_*.sh
COPY ./scripts/lkbuilder_env /
RUN chown -R ${user}:${user} /lkbuilder_env
RUN mkdir ${workspace_dir} && chown -R ${user}:${user} ${workspace_dir}
# Creating softlink to toolchain
RUN sudo ln -s ${tc_dir} /opt/tc
USER ${user}
WORKDIR /home/${user}/
ENV LC_ALL en_US.UTF-8
ENV TERM xterm-256color
ENV PATH="/opt/tc/bin:${PATH}"
ENTRYPOINT ["lkbuilder_entrypoint.sh"]
#CMD ["/bin/bash"]