-
Notifications
You must be signed in to change notification settings - Fork 109
/
Dockerfile
44 lines (41 loc) · 1.25 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
# suggested usage: docker build --rm -t elks-dist:latest . && docker run -it --name elks-dist elks-dist:latest
FROM ubuntu:20.04
ENTRYPOINT ["bash"]
# install required tools, make non-root user and switch to it
ENV USER=builder \
UID=1000 \
GID=1000 \
DEBIAN_FRONTEND=noninteractive \
DEBCONF_NONINTERACTIVE_SEEN=true
WORKDIR /elks
RUN apt-get update -qq \
&& apt-get install -y --no-install-recommends \
texinfo libncurses5-dev \
bash make g++ git libelf-dev patch \
xxd ca-certificates wget mtools \
&& rm -r /var/lib/apt/lists /var/cache/apt/archives \
&& addgroup \
--gid $GID \
"$USER" \
&& adduser \
--disabled-password \
--gecos "" \
--home "/elks" \
--ingroup "$USER" \
--no-create-home \
--uid "$UID" \
"$USER" \
&& chown $UID:$GID /elks
USER $USER
# copy in code and build cross tooling
COPY --chown=$USER:$USER . /elks
RUN mkdir -p "cross" \
&& tools/build.sh
# run the rest of the build interactively from step 3: https://github.com/jbruchon/elks/blob/master/BUILD.md
# . ./env.sh
# make menuconfig
# make all
# tarball the results and copy them out of the container
# cd image && tar -cvzf binfiles.tar.gz *.bin
# outside the container, on the host
# docker cp elks-dist:/elks/image/binfiles.tar.gz .