mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-07-02 01:27:27 -04:00
Continue work on builder
- add conditional proxy support - use xargs to parallelize image builds - some tweaking and notes
This commit is contained in:
@ -1,12 +1,22 @@
|
||||
FROM ubuntu:22.04
|
||||
#
|
||||
# VARS
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ARG PROXY
|
||||
ENV ES_VER=8.14.2
|
||||
ENV http_proxy=${PROXY}
|
||||
#
|
||||
# Include dist
|
||||
COPY dist/ /root/dist/
|
||||
#
|
||||
RUN apt-get update -y && \
|
||||
# Check if APT_PROXY is set and configure apt to use the proxy only if it's available
|
||||
RUN bash -c 'if [ -n "${http_proxy}" ]; then \
|
||||
echo "Using APT proxy at ${http_proxy}"; \
|
||||
echo "Acquire::http::Proxy \"${http_proxy}\";" > /etc/apt/apt.conf.d/01proxy; \
|
||||
else \
|
||||
echo "APT proxy not configured, proceeding without proxy"; \
|
||||
fi' && \
|
||||
# bash -c 'echo "Acquire::http::Proxy::ports.ubuntu.com DIRECT;" > /etc/apt/apt.conf.d/99force-no-proxy' && \
|
||||
# Setup apt
|
||||
apt-get update -y && \
|
||||
apt-get install -y \
|
||||
aria2 \
|
||||
curl && \
|
||||
@ -17,13 +27,15 @@ RUN apt-get update -y && \
|
||||
if [ "$ARCH" = "aarch64" ]; then ES_ARCH="arm64"; fi && \
|
||||
echo "$ARCH" && \
|
||||
cd /root/dist/ && \
|
||||
mkdir -p /usr/share/elasticsearch/config /etc/elasticsearch && \
|
||||
cp elasticsearch.yml /etc/elasticsearch/ && \
|
||||
aria2c -s 16 -x 16 https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$ES_VER-$ES_ARCH.deb && \
|
||||
dpkg -i elasticsearch-$ES_VER-$ES_ARCH.deb && \
|
||||
dpkg --force-confold -i elasticsearch-$ES_VER-$ES_ARCH.deb && \
|
||||
#
|
||||
# Add and move files
|
||||
# rm -rf /usr/share/elasticsearch/modules/x-pack-ml && \
|
||||
mkdir -p /usr/share/elasticsearch/config && \
|
||||
cp elasticsearch.yml /etc/elasticsearch/ && \
|
||||
# mkdir -p /usr/share/elasticsearch/config && \
|
||||
# cp elasticsearch.yml /etc/elasticsearch/ && \
|
||||
#
|
||||
# Setup user, groups and configs
|
||||
groupmod -g 2000 elasticsearch && \
|
||||
@ -37,6 +49,7 @@ RUN apt-get update -y && \
|
||||
apt-get purge aria2 -y && \
|
||||
apt-get autoremove -y --purge && \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /root/.cache /root/*
|
||||
ENV http_proxy=""
|
||||
#
|
||||
# Healthcheck
|
||||
HEALTHCHECK --retries=10 CMD curl -s -XGET 'http://127.0.0.1:9200/_cat/health'
|
||||
|
@ -1,12 +1,22 @@
|
||||
FROM ubuntu:22.04
|
||||
#
|
||||
# VARS
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ARG PROXY
|
||||
ENV LS_VER=8.14.2
|
||||
ENV http_proxy=${PROXY}
|
||||
#
|
||||
# Include dist
|
||||
COPY dist/ /root/dist/
|
||||
#
|
||||
# Setup env and apt
|
||||
RUN apt-get update -y && \
|
||||
# Check if PROXY is set and configure apt to use the proxy
|
||||
RUN bash -c 'if [ -n "${http_proxy}" ]; then \
|
||||
echo "Using APT proxy at ${http_proxy}"; \
|
||||
echo "Acquire::http::Proxy \"${http_proxy}\";" > /etc/apt/apt.conf.d/01proxy; \
|
||||
else \
|
||||
echo "APT proxy not configured, proceeding without proxy"; \
|
||||
fi' && \
|
||||
# bash -c 'echo "Acquire::http::Proxy::ports.ubuntu.com DIRECT;" > /etc/apt/apt.conf.d/99force-no-proxy' && \
|
||||
# Setup apt
|
||||
apt-get update -y && \
|
||||
apt-get install -y \
|
||||
aria2 \
|
||||
bash \
|
||||
@ -57,10 +67,11 @@ RUN apt-get update -y && \
|
||||
# Clean up
|
||||
apt-get autoremove -y --purge && \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /root/.cache /root/*
|
||||
ENV http_proxy=""
|
||||
#
|
||||
# Healthcheck
|
||||
HEALTHCHECK --retries=10 CMD curl -s -XGET 'http://127.0.0.1:9600'
|
||||
#
|
||||
# Start logstash
|
||||
USER logstash:logstash
|
||||
CMD ["./entrypoint.sh"]
|
||||
CMD ["entrypoint.sh"]
|
||||
|
Reference in New Issue
Block a user