Skip to content

Commit

Permalink
for idaholab#499: change base for dashboards-helper from alpine to de…
Browse files Browse the repository at this point in the history
…bian:12-slim to avoid weirdness with alpine's busybox curl
  • Loading branch information
mmguero committed Aug 19, 2024
1 parent 7e6fe6e commit 6abaa1b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
33 changes: 21 additions & 12 deletions Dockerfiles/dashboards-helper.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG TARGETPLATFORM=linux/amd64

FROM --platform=${TARGETPLATFORM} alpine:3.20
FROM --platform=${TARGETPLATFORM} debian:12-slim

# Copyright (c) 2020 Battelle Energy Alliance, LLC. All rights reserved.
LABEL maintainer="[email protected]"
Expand Down Expand Up @@ -60,17 +60,26 @@ COPY --chmod=755 shared/bin/opensearch_read_only.py /data/
ADD scripts/malcolm_utils.py /data/

RUN export BINARCH=$(uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/') && \
apk update --no-cache && \
apk upgrade --no-cache && \
apk --no-cache add bash python3 py3-pip curl openssl procps psmisc moreutils npm rsync shadow jq tini && \
npm install -g http-server && \
apt-get -q update && \
apt-get -y -q --no-install-recommends upgrade && \
apt-get -y -q --allow-downgrades --allow-remove-essential --allow-change-held-packages install --no-install-recommends \
bash \
curl \
jq \
moreutils \
openssl \
procps \
psmisc \
python3 \
python3-pip \
rsync \
tini && \
pip3 install --break-system-packages supervisor humanfriendly requests && \
curl -fsSL -o /usr/local/bin/supercronic "${SUPERCRONIC_URL}${BINARCH}" && \
chmod +x /usr/local/bin/supercronic && \
addgroup -g ${DEFAULT_GID} ${PGROUP} ; \
adduser -D -H -u ${DEFAULT_UID} -h /nonexistant -s /sbin/nologin -G ${PGROUP} -g ${PUSER} ${PUSER} ; \
addgroup ${PUSER} tty ; \
addgroup ${PUSER} shadow ; \
groupadd --gid ${DEFAULT_GID} ${PUSER} && \
useradd -M --uid ${DEFAULT_UID} --gid ${DEFAULT_GID} -d /nonexistant -s /sbin/nologin ${PUSER} && \
usermod -a -G tty ${PUSER} && \
mkdir -p /data/init /opt/ecs && \
cd /opt && \
curl -sSL "$(curl -sSL "$ECS_RELEASES_URL" | jq '.tarball_url' | tr -d '"')" | tar xzf - -C ./ecs --strip-components 1 && \
Expand All @@ -93,17 +102,17 @@ RUN export BINARCH=$(uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/')
/opt/templates && \
chmod 755 /data/*.sh /data/*.py /data/init && \
chmod 400 /opt/maps/* && \
(echo -e "*/2 * * * * /data/shared-object-creation.sh\n0 10 * * * /data/index-refresh.py --index MALCOLM_NETWORK_INDEX_PATTERN --template malcolm_template --unassigned\n30 */2 * * * /data/index-refresh.py --index MALCOLM_OTHER_INDEX_PATTERN --template malcolm_beats_template --unassigned\n*/20 * * * * /data/opensearch_index_size_prune.py" > ${SUPERCRONIC_CRONTAB})
(echo "*/2 * * * * /data/shared-object-creation.sh\n0 10 * * * /data/index-refresh.py --index MALCOLM_NETWORK_INDEX_PATTERN --template malcolm_template --unassigned\n30 */2 * * * /data/index-refresh.py --index MALCOLM_OTHER_INDEX_PATTERN --template malcolm_beats_template --unassigned\n*/20 * * * * /data/opensearch_index_size_prune.py" > ${SUPERCRONIC_CRONTAB})
EXPOSE $OFFLINE_REGION_MAPS_PORT
ENTRYPOINT ["/sbin/tini", \
ENTRYPOINT ["/usr/bin/tini", \
"--", \
"/usr/local/bin/docker-uid-gid-setup.sh", \
"/usr/local/bin/service_check_passthrough.sh", \
"-s", "dashboards-helper"]
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf", "-n"]
CMD ["/usr/local/bin/supervisord", "-c", "/etc/supervisord.conf", "-n"]
VOLUME ["/data/init"]
Expand Down
7 changes: 6 additions & 1 deletion dashboards/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ stdout_logfile_maxbytes=0
redirect_stderr=true

[program:maps]
command=/usr/local/bin/http-server /opt/maps --cors='*' -d false -i false --no-dotfiles -p %(ENV_OFFLINE_REGION_MAPS_PORT)s
command=/usr/bin/goStatic
-path /opt/maps
-port %(ENV_OFFLINE_REGION_MAPS_PORT)s
-append-header 'Access-Control-Allow-Origin:*'
-enable-health
-vhost ''
autostart=true
autorestart=true
startsecs=0
Expand Down
4 changes: 2 additions & 2 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ Then, go take a walk or something since it will be a while. When you are done, y

* `ghcr.io/idaholab/malcolm/api` (based on `python:3-slim`)
* `ghcr.io/idaholab/malcolm/arkime` (based on `debian:12-slim`)
* `ghcr.io/idaholab/malcolm/dashboards-helper` (based on `alpine:3.20`)
* `ghcr.io/idaholab/malcolm/dashboards-helper` (based on `debian:12-slim`)
* `ghcr.io/idaholab/malcolm/dashboards` (based on `opensearchproject/opensearch-dashboards`)
* `ghcr.io/idaholab/malcolm/file-monitor` (based on `debian:12-slim`)
* `ghcr.io/idaholab/malcolm/file-upload` (based on `debian:12-slim`)
* `ghcr.io/idaholab/malcolm/filebeat-oss` (based on `docker.elastic.co/beats/filebeat-oss`)
* `ghcr.io/idaholab/malcolm/freq` (based on `debian:12-slim`)
* `ghcr.io/idaholab/malcolm/htadmin` (based on `debian:11-slim`)
* `ghcr.io/idaholab/malcolm/logstash-oss` (based on `opensearchproject/logstash-oss-with-opensearch-output-plugin`)
* `ghcr.io/idaholab/malcolm/logstash-oss` (based on `docker.elastic.co/logstash/logstash-oss`)
* `ghcr.io/idaholab/malcolm/netbox` (based on `netboxcommunity/netbox:latest`)
* `ghcr.io/idaholab/malcolm/nginx-proxy` (based on `alpine:3.20`)
* `ghcr.io/idaholab/malcolm/opensearch` (based on `opensearchproject/opensearch`)
Expand Down

0 comments on commit 6abaa1b

Please sign in to comment.