forked from aircrack-ng/aircrack-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.release
60 lines (52 loc) · 1.8 KB
/
Dockerfile.release
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
ARG IMAGE_BASE=debian:unstable-slim
# hadolint ignore=DL3006
FROM ${IMAGE_BASE} AS builder
# https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
# Tag name
ARG GITHUB_REF_NAME
# Install dependencies for building
COPY docker_package_install.sh /opt
RUN sh /opt/docker_package_install.sh builder
# Create git archive
# hadolint ignore=DL3059
RUN mkdir -p /aircrack-ng/git /aircrack-ng/archive /output
COPY . /aircrack-ng/git
WORKDIR /aircrack-ng/git
# hadolint ignore=DL4006,SC3040
RUN set -o pipefail && \
git archive --format=tar ${GITHUB_REF_NAME} \
| tar -xf - --directory /aircrack-ng/archive
# Build Aircrack-ng
WORKDIR /aircrack-ng/archive
RUN set -x \
&& make distclean || : && \
autoreconf -vif && \
set -e; \
./configure --with-experimental --with-ext-scripts --enable-maintainer-mode --without-opt --prefix=/usr && \
make -j$(nproc) && \
make check -j$(nproc) && \
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