Updated Continerfiles to minimize size

This commit is contained in:
barry 2024-02-19 06:48:17 -06:00
parent 5fc7b39b61
commit 3095ff8d2c
7 changed files with 27 additions and 18 deletions

View File

@ -41,6 +41,7 @@ RUN wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/downloa
FROM docker.io/almalinux/9-minimal:latest
LABEL maintainer="b0xxer@b0xxy.net"
ENTRYPOINT ["entrypoint.sh"]
ENV HOME /bitcoin
EXPOSE 8332 8333
@ -50,7 +51,8 @@ WORKDIR /bitcoin
COPY --from=build /opt/ /opt/
COPY --from=build /usr/local/bin/gosu /usr/local/bin/
RUN microdnf update -y \
RUN printf "tsflags=nodocs\n" >>/etc/dnf/dnf.conf \
&& microdnf update -y \
&& microdnf install -y libatomic shadow-utils \
&& microdnf clean all && rm -rf /tmp/* /var/tmp/* \
&& ln -sv /opt/bitcoin/bin/* /usr/local/bin
@ -63,6 +65,7 @@ RUN groupadd -g ${GROUP_ID} bitcoin \
COPY ./bin ./entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh && chmod +x /usr/local/bin/gosu \
&& chmod +x /usr/local/bin/btc_oneshot && chmod +x /usr/local/bin/btc_init
&& chmod +x /usr/local/bin/btc_oneshot && chmod +x /usr/local/bin/btc_init \
&& rm -rf /var/cache/* /var/log* /tmp/*
CMD ["btc_oneshot"]

View File

@ -2,13 +2,15 @@ FROM docker.io/almalinux/9-minimal:latest
LABEL maintainer="n0x@n0xb0x.org"
COPY requirements.txt requirements.txt
RUN microdnf update -y \
RUN printf "tsflags=nodocs\n" >>/etc/dnf/dnf.conf \
&& microdnf update -y \
&& microdnf install -y \
ca-certificates \
python3 \
python3-pip \
&& microdnf clean all && rm -fr /tmp/* /var/tmp/* \
&& pip3 install -r requirements.txt
&& microdnf clean all \
&& pip3 install -r requirements.txt \
&& rm -rf /var/cache/* /var/log* /tmp/*
EXPOSE 8081 80

View File

@ -8,5 +8,6 @@
file: "{{ item }}"
with_items:
- "{{ app_list }}"
tags: apps
tags:
- apps

View File

@ -28,7 +28,9 @@ FROM docker.io/almalinux/9-base:latest
COPY --from=builder /usr/local/ /usr/local/
RUN dnf update -y && dnf install -y ca-certificates \
RUN printf "tsflags=nodocs\n" >>/etc/dnf/dnf.conf \
&& dnf update -y \
&& dnf install -y ca-certificates \
gnupg2 \
libatomic \
wget \
@ -39,8 +41,8 @@ RUN dnf update -y && dnf install -y ca-certificates \
python3-setuptools \
python3-pip \
micropipenv \
&& dnf clean all && rm -fr /tmp/* /var/tmp/* \
&& cd /usr/local/libexec/c-lightning/plugins/clnrest/ && micropipenv install --method requirements
&& cd /usr/local/libexec/c-lightning/plugins/clnrest/ && micropipenv install --method requirements \
&& rm -rf /var/cache/* /var/log* /tmp/*
COPY ./entrypoint.sh /entrypoint.sh

View File

@ -1,7 +1,5 @@
#Adapted from iangregsondev - https://github.com/iangregsondev/electrs-docker/blob/main/Dockerfile
#FROM rust:1.44.1-slim-buster AS builder
FROM docker.io/almalinux/9-base:latest as builder
ARG VERSION=v{{ electrs_version }}
@ -17,11 +15,12 @@ RUN git clone --branch $VERSION $REPO .
RUN cargo build --release --bin electrs
#FROM debian:buster-slim
FROM docker.io/almalinux/9-minimal:latest
RUN microdnf update -y && microdnf clean all
RUN printf "tsflags=nodocs\n" >>/etc/dnf/dnf.conf \
&& microdnf update -y \
&& microdnf clean all \
&& rm -rf /var/cache/* /var/log* /tmp/*
COPY --from=builder /build/target/release/electrs /bin/electrs

View File

@ -4,7 +4,8 @@ ENV LNBITS_VER={{lnbits_version}}
WORKDIR /app
RUN dnf update -y \
RUN printf "tsflags=nodocs\n" >>/etc/dnf/dnf.conf \
&& dnf update -y \
&& dnf install -y git \
python3.11 \
python3.11-devel \
@ -26,7 +27,7 @@ RUN dnf update -y \
COPY .env .env
RUN dnf autoremove -y python3.11-devel gcc automake make \
&& dnf clean all \
&& rm -fr /tmp/*
&& rm -rf /var/cache/* /var/log* /tmp/*
ENV PATH="/root/.local/bin:$PATH"
ENV LNBITS_PORT="5000"

View File

@ -29,11 +29,12 @@ RUN npm prune --production
# ---------------
FROM docker.io/almalinux/9-init
RUN dnf update -y \
RUN printf "tsflags=nodocs\n" >>/etc/dnf/dnf.conf \
&& dnf update -y \
&& dnf module -y enable nodejs:18 \
&& dnf install -y nodejs \
&& dnf clean all \
&& rm -fr /tmp/*
&& rm -rf /var/cache/* /var/log* /tmp/*
WORKDIR /RTL