Skip to content

Commit 3b6aaba

Browse files
committed
Adding Dockerfile for compiling cross and kernel
1 parent 1865cc9 commit 3b6aaba

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

.dockerignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.git
2+
.github
3+
Documentation
4+
Screenshots
5+

Dockerfile

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# suggested usage: docker build --rm -t elks-dist:latest . && docker run -it --name elks-dist elks-dist:latest
2+
FROM ubuntu:20.04
3+
ENTRYPOINT ["bash"]
4+
# install required tools, make non-root user and switch to it
5+
ENV USER=builder \
6+
UID=1000 \
7+
GID=1000 \
8+
DEBIAN_FRONTEND=noninteractive \
9+
DEBCONF_NONINTERACTIVE_SEEN=true
10+
WORKDIR /elks
11+
RUN apt-get update -qq \
12+
&& apt-get install -y --no-install-recommends \
13+
flex bison texinfo libncurses5-dev \
14+
bash make g++ git libelf-dev \
15+
xxd ca-certificates wget mtools \
16+
&& rm -r /var/lib/apt/lists /var/cache/apt/archives \
17+
&& addgroup \
18+
--gid $GID \
19+
"$USER" \
20+
&& adduser \
21+
--disabled-password \
22+
--gecos "" \
23+
--home "/elks" \
24+
--ingroup "$USER" \
25+
--no-create-home \
26+
--uid "$UID" \
27+
"$USER" \
28+
&& chown $UID:$GID /elks
29+
USER $USER
30+
# copy in code and build cross tooling
31+
COPY --chown=$USER:$USER . /elks
32+
RUN mkdir -p "cross" \
33+
&& tools/build.sh
34+
35+
# run the rest of the build interactively from step 3: https://github.com/jbruchon/elks/blob/master/BUILD.md
36+
# . ./env.sh
37+
# make menuconfig
38+
# make all
39+
40+
# tarball the results and copy them out of the container
41+
# cd image && tar -cvzf binfiles.tar.gz *.bin
42+
43+
# outside the container, on the host
44+
# docker cp elks-dist:/elks/image/binfiles.tar.gz .

0 commit comments

Comments
 (0)