Skip to content

Commit

Permalink
Remove s6-overlay and install supercronic APK (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
MattKobayashi authored Sep 28, 2024
1 parent e51249a commit 5782b03
Show file tree
Hide file tree
Showing 44 changed files with 25 additions and 215 deletions.
3 changes: 1 addition & 2 deletions avahi/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
FROM alpine:3.20.3
RUN apk --no-cache upgrade \
&& apk add --update --no-cache avahi augeas
RUN apk --no-cache add avahi augeas

RUN mkdir /opt/avahi
COPY entrypoint.sh /opt/avahi/
Expand Down
17 changes: 1 addition & 16 deletions certbot-cloudflare/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
FROM certbot/dns-cloudflare:v2.11.0

ARG TARGETPLATFORM
ENV SUPERCRONIC_SHA1SUM_amd64=cd48d45c4b10f3f0bfdd3a57d054cd05ac96812b \
SUPERCRONIC_SHA1SUM_arm=75e065bf0909f920b06d5bd797c0e6b31e68b112 \
SUPERCRONIC_SHA1SUM_arm64=512f6736450c56555e01b363144c3c9d23abed4c \
SUPERCRONIC_SHA1SUM_i386=3436985298ce241d7d9477eb9eab164b582717a8 \
SUPERCRONIC_VERSION=v0.2.29

RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then ARCH=amd64; elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then ARCH=arm; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCH=arm64; elif [ "$TARGETPLATFORM" = "linux/i386" ]; then ARCH=i386; else exit 1; fi \
&& export SUPERCRONIC="supercronic-linux-${ARCH}" \
&& export SUPERCRONIC_URL="https://github.com/aptible/supercronic/releases/download/${SUPERCRONIC_VERSION}/${SUPERCRONIC}" \
&& wget "$SUPERCRONIC_URL" \
&& eval SUPERCRONIC_SHA1SUM='$SUPERCRONIC_SHA1SUM_'$ARCH \
&& echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \
&& chmod +x "${SUPERCRONIC}" \
&& mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \
&& ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic \
RUN apk --no-cache add supercronic \
&& mkdir /crontab/ \
&& mkdir /opt/certs/

Expand Down
2 changes: 1 addition & 1 deletion certbot-cloudflare/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ domain = $DOMAIN
email = $EMAIL
EOF

exec supercronic /crontab/certbot-cron
exec /usr/bin/supercronic /crontab/certbot-cron
24 changes: 2 additions & 22 deletions fullbogons/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
FROM alpine:3.20.3

# Set supercronic environment variables
ARG TARGETPLATFORM
ENV SUPERCRONIC_SHA1SUM_amd64=cd48d45c4b10f3f0bfdd3a57d054cd05ac96812b \
SUPERCRONIC_SHA1SUM_arm=75e065bf0909f920b06d5bd797c0e6b31e68b112 \
SUPERCRONIC_SHA1SUM_arm64=512f6736450c56555e01b363144c3c9d23abed4c \
SUPERCRONIC_SHA1SUM_i386=3436985298ce241d7d9477eb9eab164b582717a8 \
SUPERCRONIC_VERSION=v0.2.29

# Install supercronic
WORKDIR /supercronic

RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then ARCH=amd64; elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then ARCH=arm; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCH=arm64; elif [ "$TARGETPLATFORM" = "linux/i386" ]; then ARCH=i386; else exit 1; fi \
&& export SUPERCRONIC="supercronic-linux-${ARCH}" \
&& export SUPERCRONIC_URL="https://github.com/aptible/supercronic/releases/download/${SUPERCRONIC_VERSION}/${SUPERCRONIC}" \
&& wget "$SUPERCRONIC_URL" \
&& eval SUPERCRONIC_SHA1SUM='$SUPERCRONIC_SHA1SUM_'$ARCH \
&& echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \
&& chmod +x "${SUPERCRONIC}" \
&& mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \
&& ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic
RUN apk --no-cache add supercronic

# Set BIRD environment variables
ENV SOURCE_FILE=bird.tar.gz \
Expand All @@ -28,8 +9,7 @@ ENV SOURCE_FILE=bird.tar.gz \

# Install BIRD
WORKDIR /bird
RUN apk --no-cache upgrade \
&& apk --no-cache add tar build-base autoconf flex bison linux-headers ncurses-dev libssh-dev readline-dev \
RUN apk --no-cache add tar build-base autoconf flex bison linux-headers ncurses-dev libssh-dev readline-dev \
&& wget -O "$SOURCE_FILE" "$SOURCE_URL" \
&& echo "${SOURCE_SHA1SUM} ${SOURCE_FILE}" | sha1sum -c - \
&& tar -xz --strip-components=1 --file="$SOURCE_FILE" \
Expand Down
2 changes: 1 addition & 1 deletion fullbogons/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ cleanup() {
trap 'cleanup; exit 130' INT
trap 'cleanup; exit 143' TERM

supercronic /bird/crontab/fullbogons-cron &
/usr/bin/supercronic /bird/crontab/fullbogons-cron &
bird -u bird -c bird.conf -d & wait $!
3 changes: 1 addition & 2 deletions growatt-ev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ FROM python:3.12.6-alpine3.20

WORKDIR /opt/growatt-ev/

RUN apk --no-cache upgrade \
&& adduser --system growatt-ev \
RUN adduser --system growatt-ev \
&& python3 -m pip install --break-system-packages paho-mqtt tuya-connector-python

COPY --chown=growatt-ev main.py main.py
Expand Down
2 changes: 1 addition & 1 deletion influx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ADD https://dl.influxdata.com/influxdb/releases/influxdb2-client-${INFLUX_CLI_VE
ADD https://dl.influxdata.com/influxdb/releases/influxdb2-client-${INFLUX_CLI_VERSION}-${TARGETOS}-${TARGETARCH}.tar.gz.asc /tmp/

# Verify downloaded binaries
RUN apk add gpg gpg-agent \
RUN apk --no-cache add gpg gpg-agent \
&& curl -s https://repos.influxdata.com/influxdata-archive_compat.key | gpg --import - \
&& gpg --verify /tmp/influxdb2-${INFLUX_DB_VERSION}-${TARGETOS}-${TARGETARCH}.tar.gz.asc /tmp/influxdb2-${INFLUX_DB_VERSION}-${TARGETOS}-${TARGETARCH}.tar.gz \
&& gpg --verify /tmp/influxdb2-${INFLUX_CLI_VERSION}-${TARGETOS}-${TARGETARCH}.tar.gz.asc /tmp/influxdb2-${INFLUX_CLI_VERSION}-${TARGETOS}-${TARGETARCH}.tar.gz \
Expand Down
4 changes: 1 addition & 3 deletions iperf2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ ENV SOURCE_FILE=iperf2.tar.gz \

# Download source file, extract and compile
WORKDIR /iperf2
RUN apk --no-cache upgrade \
&& apk --no-cache add tar build-base \
RUN apk --no-cache add tar build-base \
&& wget -O "$SOURCE_FILE" "$SOURCE_URL" \
&& echo "${SOURCE_SHA1SUM} ${SOURCE_FILE}" | sha1sum -c - \
&& tar -xz --strip-components=1 --file="$SOURCE_FILE" \
Expand All @@ -19,7 +18,6 @@ FROM alpine:3.20.3

# Copy relevant compiled files to distribution image
RUN adduser --system iperf2 \
&& apk --no-cache upgrade \
&& apk --no-cache add libgcc libstdc++
COPY --from=buildenv /usr/local/bin/ /usr/local/bin/
COPY --from=buildenv /usr/local/share/man/ /usr/local/share/man/
Expand Down
6 changes: 2 additions & 4 deletions iperf3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ ENV SOURCE_FILE=iperf3.tar.gz \

# Download source file, extract and compile
WORKDIR /iperf3
RUN apk --no-cache upgrade \
&& apk --no-cache add tar build-base \
RUN apk --no-cache add tar build-base \
&& wget -O "$SOURCE_FILE" "$SOURCE_URL" \
&& echo "${SOURCE_SHA1SUM} ${SOURCE_FILE}" | sha1sum -c - \
&& tar -xz --strip-components=1 --file="$SOURCE_FILE" \
Expand All @@ -19,8 +18,7 @@ FROM alpine:3.20.3

# Copy relevant compiled files to distribution image
RUN adduser --system iperf3 \
&& ldconfig -n /usr/local/lib \
&& apk --no-cache upgrade
&& ldconfig -n /usr/local/lib
COPY --from=buildenv /usr/local/lib/ /usr/local/lib/
COPY --from=buildenv /usr/local/bin/ /usr/local/bin/
COPY --from=buildenv /usr/local/include/ /usr/local/include/
Expand Down
1 change: 0 additions & 1 deletion irrd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ FROM python:3.12-slim-bookworm

# Install xz
RUN apt-get update \
&& apt-get --yes upgrade \
&& apt-get --yes install xz-utils

# Add s6-overlay
Expand Down
1 change: 0 additions & 1 deletion irrexplorer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM python:3.12.6-alpine3.20

RUN adduser --system irrexplorer \
&& apk --no-cache upgrade \
&& apk --no-cache add tar build-base python3-dev poetry npm yarn

USER irrexplorer
Expand Down
21 changes: 3 additions & 18 deletions mdns-reflector/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ ENV SOURCE_FILE=mdns-reflector.tar.gz \

# Download source file, extract and compile
WORKDIR /mdns-reflector
RUN apk --no-cache upgrade \
&& apk --no-cache add tar build-base cmake \
RUN apk --no-cache add tar build-base cmake \
&& wget -O "$SOURCE_FILE" "$SOURCE_URL" \
&& echo "${SOURCE_SHA1SUM} ${SOURCE_FILE}" | sha1sum -c - \
&& tar -xz --strip-components=1 --file="$SOURCE_FILE" \
Expand All @@ -18,28 +17,14 @@ RUN apk --no-cache upgrade \

FROM alpine:3.20.3

# Add s6-overlay
WORKDIR /tmp
ENV S6_OVERLAY_VERSION=3.2.0.0
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz.sha256 /tmp
RUN echo "$(cat s6-overlay-noarch.tar.xz.sha256)" | sha256sum -c - \
&& tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz.sha256 /tmp
RUN echo "$(cat s6-overlay-x86_64.tar.xz.sha256)" | sha256sum -c - \
&& tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz
COPY s6-rc.d/ /etc/s6-overlay/s6-rc.d/

# Copy relevant compiled files to distribution image
RUN adduser --system mdns-reflector \
&& apk --no-cache upgrade
RUN adduser --system mdns-reflector
COPY --from=buildenv /usr/local/bin/ /usr/local/bin/

# Switch to non-root user
USER mdns-reflector

# Set entrypoint
ENTRYPOINT ["/init"]
ENTRYPOINT ["mdns-reflector"]

LABEL org.opencontainers.image.authors="MattKobayashi <[email protected]>"
Empty file.
9 changes: 0 additions & 9 deletions mdns-reflector/s6-rc.d/svc-mdns-reflector/finish

This file was deleted.

2 changes: 0 additions & 2 deletions mdns-reflector/s6-rc.d/svc-mdns-reflector/run

This file was deleted.

1 change: 0 additions & 1 deletion mdns-reflector/s6-rc.d/svc-mdns-reflector/type

This file was deleted.

Empty file.
Empty file.
3 changes: 1 addition & 2 deletions oxidized/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ ENV SOURCE_FILE=oxidized.tar.gz \

# Download source file, extract and compile
WORKDIR /tmp/oxidized
RUN apk --no-cache upgrade \
&& apk --no-cache add build-base cmake git libpq-dev mariadb-dev libssh2-dev icu-dev yq \
RUN apk --no-cache add build-base cmake git libpq-dev mariadb-dev libssh2-dev icu-dev yq \
&& git clone https://github.com/ytti/oxidized.git . \
&& git checkout $VERSION \
&& gem install --no-document aws-sdk slack-ruby-client xmpp4r cisco_spark rugged \
Expand Down
3 changes: 1 addition & 2 deletions rng-tools/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
FROM alpine:3.20.3

# Uprade and install packages to image
RUN apk --no-cache upgrade \
&& apk --no-cache add rng-tools
RUN apk --no-cache add rng-tools

# Set entrypoint
ENTRYPOINT ["rngd"]
Expand Down
19 changes: 1 addition & 18 deletions speedtest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,8 @@ FROM debian:12.7-slim

# Install xz-utils
RUN apt-get update \
&& apt-get --yes upgrade \
&& apt-get --yes install xz-utils wget

# Add s6-overlay
WORKDIR /tmp
ENV S6_OVERLAY_VERSION=3.2.0.0
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz.sha256 /tmp
RUN echo "$(cat s6-overlay-noarch.tar.xz.sha256)" | sha256sum -c - \
&& tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz.sha256 /tmp
RUN echo "$(cat s6-overlay-x86_64.tar.xz.sha256)" | sha256sum -c - \
&& tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz
COPY s6-rc.d/ /etc/s6-overlay/s6-rc.d/

# Set work directory
WORKDIR /opt/speedtest/

Expand All @@ -27,10 +13,7 @@ RUN wget https://install.speedtest.net/app/cli/ookla-speedtest-1.2.0-linux-x86_6
&& apt-get --yes remove xz-utils wget \
&& apt-get --yes autoremove

# Copy files
COPY speedtest.sh /opt/scripts/

# Set entrypoint
ENTRYPOINT ["/init"]
ENTRYPOINT ["/opt/speedtest/speedtest", "--accept-license", "--progress=no"]

LABEL org.opencontainers.image.authors="MattKobayashi <[email protected]>"
Empty file.
1 change: 0 additions & 1 deletion speedtest/s6-rc.d/init-speedtest/type

This file was deleted.

2 changes: 0 additions & 2 deletions speedtest/s6-rc.d/init-speedtest/up

This file was deleted.

Empty file.
2 changes: 0 additions & 2 deletions speedtest/speedtest.sh

This file was deleted.

4 changes: 1 addition & 3 deletions stun/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ ENV SOURCE_HASH=4479e1ae070651dfc4836a998267c7ac2fba4f011abcfdca3b8ccd7736d4fd26

WORKDIR /stuntman

RUN apk --no-cache upgrade \
&& apk --no-cache add build-base boost-dev openssl-dev wget tar \
RUN apk --no-cache add build-base boost-dev openssl-dev wget tar \
&& wget -O $SOURCE_FILE https://www.stunprotocol.org/stunserver-$SOURCE_VERSION.tgz \
&& echo "$SOURCE_HASH $SOURCE_FILE" | sha256sum -c \
&& tar -xz --strip-components=1 --file="$SOURCE_FILE" \
Expand All @@ -18,7 +17,6 @@ FROM alpine:3.20.3
WORKDIR /stuntman

RUN addgroup -S stuntman && adduser -S stuntman -G stuntman \
&& apk --no-cache upgrade \
&& apk --no-cache add libstdc++ libgcc

USER stuntman
Expand Down
7 changes: 1 addition & 6 deletions telegraf/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ WORKDIR /opt/docker-telegraf

# Install Python and requirements
COPY requirements.txt .
RUN apk --no-cache upgrade \
&& apk --no-cache add python3 py3-requests

# Install other dependencies
RUN apk --no-cache upgrade \
&& apk --no-cache add telegraf smartmontools jq curl lm-sensors wget
RUN apk --no-cache add python3 py3-requests telegraf smartmontools jq curl lm-sensors wget

# Install Ookla Speedtest CLI utility
WORKDIR /opt/ookla
Expand Down
Empty file.
9 changes: 0 additions & 9 deletions telegraf/s6-rc.d/svc-telegraf/finish

This file was deleted.

3 changes: 0 additions & 3 deletions telegraf/s6-rc.d/svc-telegraf/run

This file was deleted.

1 change: 0 additions & 1 deletion telegraf/s6-rc.d/svc-telegraf/type

This file was deleted.

Empty file removed telegraf/s6-rc.d/svc-telegraf/up
Empty file.
Empty file.
5 changes: 2 additions & 3 deletions vyos-release-alert/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ FROM python:3.12.6-alpine3.20

WORKDIR /opt/vyos-blog-alert

RUN apk --no-cache upgrade \
&& apk --no-cache add supercronic \
RUN apk --no-cache add supercronic \
&& python3 -m pip install --break-system-packages feedparser

COPY main.py main.py
COPY crontab crontab

ENTRYPOINT ["supercronic", "/opt/vyos-blog-alert/crontab"]
ENTRYPOINT ["/usr/bin/supercronic", "/opt/vyos-blog-alert/crontab"]

LABEL org.opencontainers.image.authors="MattKobayashi <[email protected]>"
18 changes: 2 additions & 16 deletions xteve/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
FROM alpine:3.20.3

# Add s6-overlay
WORKDIR /tmp
ENV S6_OVERLAY_VERSION=3.2.0.0
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz.sha256 /tmp
RUN echo "$(cat s6-overlay-noarch.tar.xz.sha256)" | sha256sum -c - \
&& tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz.sha256 /tmp
RUN echo "$(cat s6-overlay-x86_64.tar.xz.sha256)" | sha256sum -c - \
&& tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz
COPY s6-rc.d/ /etc/s6-overlay/s6-rc.d/

# Install dependencies and set timezone
RUN apk --no-cache upgrade \
&& apk add --no-cache ca-certificates curl tzdata bash busybox-suid su-exec ffmpeg vlc \
RUN apk add --no-cache ca-certificates curl tzdata bash busybox-suid su-exec ffmpeg vlc \
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
&& sed -i 's/geteuid/getppid/' /usr/bin/vlc

Expand All @@ -34,6 +20,6 @@ RUN chmod +x /entrypoint.sh \
EXPOSE 34400

# Set entrypoint
ENTRYPOINT ["/init"]
ENTRYPOINT ["/entrypoint.sh"]

LABEL org.opencontainers.image.authors="MattKobayashi <[email protected]>, alturismo <[email protected]>"
Empty file.
9 changes: 0 additions & 9 deletions xteve/s6-rc.d/svc-xteve/finish

This file was deleted.

Loading

0 comments on commit 5782b03

Please sign in to comment.