Continue work on builder

- add conditional proxy support
- use xargs to parallelize image builds
- some tweaking and notes
This commit is contained in:
t3chn0m4g3
2024-09-07 00:35:04 +00:00
parent acf09bc160
commit 024d79d001
10 changed files with 123 additions and 25 deletions

View File

@ -1,10 +1,19 @@
FROM alpine:3.19
ARG PROXY
ENV http_proxy=${PROXY}
#
# Include dist
COPY dist/ /root/dist/
#
# Install packages
RUN apk --no-cache -U add \
# Install packages, use proxy if available and cache using http
RUN ash -c 'if [ -n "${http_proxy}" ]; then \
sed -i "s/https/http/g" /etc/apk/repositories; \
echo "Using HTTP Proxy at ${http_proxy}"; \
else \
echo "HTTP Proxy not configured, proceeding without proxy"; \
fi' && \
# Setup apk
apk --no-cache -U add \
git \
procps \
py3-psutil \
@ -28,7 +37,9 @@ RUN apk --no-cache -U add \
#
# Clean up
apk del --purge git && \
sed -i "s/http/https/g" /etc/apk/repositories && \
rm -rf /root/* /opt/adbhoney/.git /var/cache/apk/*
ENV http_proxy=""
#
# Set workdir and start adbhoney
STOPSIGNAL SIGINT