forked from aircrack-ng/aircrack-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
59 lines (53 loc) · 1.65 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
ARG IMAGE_BASE=debian:unstable-slim
# hadolint ignore=DL3006
FROM ${IMAGE_BASE} AS builder
# Install dependencies for building
COPY docker_package_install.sh /
RUN sh /docker_package_install.sh builder
# Build Aircrack-ng
# hadolint ignore=DL3059
RUN mkdir -p /aircrack-ng /output
COPY . /aircrack-ng
WORKDIR /aircrack-ng
# hadolint ignore=SC2006
RUN set -x \
&& make distclean || : && \
autoreconf -vif && \
set -e; \
./configure --with-experimental --with-ext-scripts --enable-maintainer-mode --prefix=/usr/local && \
make -j3 && \
set +e && \
if ! make check -j3; then \
echo "Processor: $(uname -m)"; \
for file in `grep -l "(exit status: [1-9]" test/*.log`; do \
echo "[*] Test ${file}:"; \
cat "${file}"; \
done; \
exit 1; \
fi && \
set -e && \
make install DESTDIR=/output
# Stage 2
# hadolint ignore=DL3006
FROM ${IMAGE_BASE}
# Due to the behavior of buildx failing to copy to directories being
# a symlink (whereas docker build works), copy the content to /output
# then manually move all the files in /usr/local
# In Arch-based distros, /usr/local/share/man is a symlink
RUN mkdir /output
COPY --from=builder /output/usr /output
# And another workaround for Clear Linux where this directory does not exist
# hadolint ignore=SC2015
RUN set -x && \
[ -d /usr/local/share/man ] || \
mkdir -p /usr/local/share/man
RUN mv /output/local/share/man/* /usr/local/share/man/ && \
rmdir /output/local/share/man/ && \
cp -r /output/* /usr/ && \
rm -rf /output
COPY docker_package_install.sh /
# Install dependencies
RUN set -x \
&& sh /docker_package_install.sh stage2 \
&& rm /docker_package_install.sh \
&& aircrack-ng -u