/
Dockerfile
128 lines (84 loc) · 3.91 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
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
FROM ubuntu:23.04
MAINTAINER dreamcat4 <dreamcat4@gmail.com>
ARG _clean="rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*"
ARG _apt_clean="eval apt-get clean && $_clean"
ARG DEBIAN_FRONTEND=noninteractive
# apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y
# Supportive pkgs
RUN apt-get update -qqy && apt-get install -y \
lsb-release iproute2 net-tools wget curl iputils-ping net-tools iproute2 git sudo nano less man && $_apt_clean
# Output folder
RUN mkdir -p /out
# ===
# dnsmasq - install build time dependancies
RUN apt-get update -qqy && apt-get install -y ca-certificates make gcc && $_apt_clean
# dnsmasq - Build from source
RUN mkdir -p /build/dnsmasq
WORKDIR /build/dnsmasq
# dnsmasq - git checkout
RUN git clone git://thekelleys.org.uk/dnsmasq.git && cd dnsmasq \
&& dnsmasq_version="$(git tag | grep -E 'v[0-9][0-9]*\.[0-9][0-9][rc]*[0-9]*$' | sort | tail -1)" \
&& release_version=$(git tag | grep -E "^${dnsmasq_version%rc*}$" || true) \
&& if [ "$release_version" ]; then dnsmasq_version=$release_version; fi \
&& echo "$dnsmasq_version" > /out/dnsmasq_version \
&& git checkout "${dnsmasq_version}"
# dnsmasq - compile & install
RUN cd dnsmasq && sed -i -e 's|/usr/local|/usr|' Makefile && make install DESTDIR=$PWD/out \
&& mkdir -p out/etc && cp dnsmasq.conf.example out/etc/
# dnsmasq - Create tarball in /out/
RUN cd dnsmasq/out && tar -czvf /out/dnsmasq-$(cat /out/dnsmasq_version)_linux-x86_64.tar.gz *
# ===
# ipxe - install build time dependancies
RUN apt-get update -qqy && apt-get install -y \
gcc binutils make perl syslinux liblzma-dev genisoimage && $_apt_clean
# ipxe - Build from source
RUN mkdir -p /build/ipxe \
&& date -I > /out/ipxe_version
WORKDIR /build/ipxe
# ipxe - git checkout
RUN git clone git://git.ipxe.org/ipxe.git
# RUN cd ipxe \
# && ipxe_version="$(git tag | grep -E 'v[0-9][0-9]*\.[0-9]\.[0-9][-rc]*[0-9]*$' | sort | tail -1)" \
# && release_version=$(git tag | grep -E "^${ipxe_version%-rc*}$" || true) \
# && if [ "$release_version" ]; then ipxe_version=$release_version; fi \
# && echo "$ipxe_version" > /out/ipxe_version \
# && git checkout "${ipxe_version}"
# Disable entropy gathering - avoids +20 seconds boot delay
ADD ipxe/nocrypto /build/ipxe/ipxe/src/config/local/nocrypto
# ipxe - compile & install
RUN cd ipxe/src \
&& CONFIG=nocrypto make bin/undionly.kpxe \
&& CONFIG=nocrypto make bin-x86_64-efi/ipxe.efi
RUN mkdir -p out \
&& cp ipxe/src/bin/undionly.kpxe out/ \
&& cp ipxe/src/bin-x86_64-efi/ipxe.efi out/
# ipxe - Create tarball in /out/
RUN cd /build/ipxe/out && tar -czvf /out/ipxe-$(cat /out/ipxe_version)_linux-x86_64.tar.gz *
# # ===
# # istgt - install build time dependancies
# RUN apt-get update -qqy && apt-get install -y \
# curl wget gcc binutils make libssl-dev && $_apt_clean
# # istgt - Build from source
# RUN mkdir -p /build/istgt \
# && curl --silent http://svnweb.freebsd.org/ports/head/net/istgt/Makefile?view=co | grep "PORTVERSION=" | cut -f2 > /out/istgt_version
# WORKDIR /build/istgt - dead
# # istgt - download source tarball
# RUN wget http://www.peach.ne.jp/archives/istgt/istgt-$(cat /out/istgt_version).tar.gz \
# && tar -zxf istgt-$(cat /out/istgt_version).tar.gz && ln -sf istgt-$(cat /out/istgt_version) istgt
# # istgt - compile & install
# RUN cd istgt \
# && ./configure --sysconfdir=/etc --localstatedir=/var \
# --localedir=/usr/share/locale --datarootdir=/usr/share --prefix=/usr --enable-symlink-device \
# && make && make install DESTDIR=$PWD/out
# # istgt - Create tarball in /out/
# RUN cd /build/istgt/istgt/out && tar -czvf /out/istgt-$(cat /out/istgt_version)_linux-x86_64.tar.gz *
# Upload linux binaries --> bintray.com
WORKDIR /out
ADD upload-to-bintray /bin/
RUN chmod +x /bin/upload-to-bintray
# Execute our upload script
# ADD bintray-env /out/
# RUN upload-to-bintray && rm /out/bintray-env && ls -lsa /out/
# Default container settings
VOLUME /out
ENTRYPOINT ["/bin/sleep","99999999"]