-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
90 lines (78 loc) · 2.01 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
# Use AlmaLinux as the base image
FROM almalinux:8
# Set working directory
WORKDIR /workspace
# Install development tools and dependencies
RUN dnf install -y \
dnf-plugins-core \
&& dnf config-manager --set-enabled powertools \
&& dnf install -y \
autoconf \
automake \
boost-devel \
bzip2 \
bzip2-devel \
cpio \
cppunit \
diffutils \
gcc \
gcc-c++ \
gettext \
gettext-devel \
git \
glibc-static \
gzip \
kernel-devel \
libgcrypt-devel \
libtool \
libxml2-devel \
make \
m4 \
openssl-devel \
sqlite-devel \
tar \
wget \
which \
xz \
zlib-devel \
&& dnf clean all
# Create the directories we'll need
RUN mkdir -p /workspace/files/bin/
# Build aria2 from release as a static binary
RUN wget https://github.com/aria2/aria2/releases/download/release-1.36.0/aria2-1.36.0.tar.gz \
&& tar -xzf aria2-1.36.0.tar.gz \
&& cd aria2-1.36.0 \
&& ./configure \
CXXFLAGS="-std=c++11" \
--enable-static \
--disable-shared \
--with-boost-libdir=/usr/lib64 \
--with-boost=/usr/include/boost \
--without-gnutls \
--without-libgcrypt \
--without-libexpat \
--without-libuv \
ARIA2_STATIC=yes \
&& make \
&& cp src/aria2c /workspace/files/bin/aria2c \
&& cd .. \
&& rm -rf aria2-1.36.0*
## Build BusyBox as a static binary
RUN git clone https://git.busybox.net/busybox \
&& cd busybox \
&& make defconfig \
&& sed -i 's/# CONFIG_STATIC is not set/CONFIG_STATIC=y/' .config \
&& make -j$(nproc) \
&& cp busybox /workspace/files/bin/busybox \
&& cd .. \
&& rm -rf busybox
# Copy project files
COPY build.sh /workspace/build.sh
RUN mkdir -p /workspace/files/etc/
COPY init /workspace/files/init
COPY ./etc/resolv.conf /workspace/files/etc/resolv.conf
# Make the build script executable
RUN chmod +x /workspace/build.sh
USER root
# Define the entrypoint to run the build script
ENTRYPOINT ["/workspace/build.sh"]