Skip to content
Snippets Groups Projects
Commit 36db818b authored by David Hoese's avatar David Hoese
Browse files

Merge branch 'feat-small-image' into 'master'

Slim down geo2grid image

See merge request !8
parents fd7d0aab b11c0290
No related branches found
No related tags found
1 merge request!8Slim down geo2grid image
Pipeline #45188 passed
......@@ -3,10 +3,11 @@
# Beta release
ARG GEO2GRID_TARBALL=https://bin.ssec.wisc.edu/pub/davidh/geo2grid-swbundle-20220613-225811.tar.gz
FROM rockylinux:8 as setup
FROM rockylinux:9-minimal as setup
ARG GEO2GRID_TARBALL
# Install geo2grid in to a generic "geo2grid" directory
RUN microdnf -y install tar findutils
RUN mkdir -p /work/geo2grid
RUN curl -o geo2grid.tar.gz -O ${GEO2GRID_TARBALL}
RUN tar -xzf geo2grid.tar.gz -C /work/geo2grid --strip-components=1
......@@ -17,22 +18,44 @@ RUN sed -i 's/METADATA_CHECKSUM=$(openssl sha256 $P2G_METADATA)/METADATA_CHECKSU
RUN /work/geo2grid/libexec/python_runtime/bin/python3 -m compileall
# Runs conda-unpack and creates the .installed file
RUN /work/geo2grid/bin/geo2grid.sh -h
# Delete unnecessary stuff
RUN rm -rf /work/geo2grid/gshhg_data /work/geo2grid/share/polar2grid/data/modifiers/*.hdf \
/work/geo2grid/libexec/python_runtime/lib/python3.10/site-packages/bokeh && \
find /work/geo2grid/pyspectral_data -mindepth 1 -maxdepth 1 \
! \( -name "*abi*" -o -name "*ahi*" -o -name "*rayleigh*" -o -name "*VERSION*" \) -exec rm -rf {} +
RUN curl -L -o flaregun.tar.gz https://gitlab.ssec.wisc.edu/rayg/flaregun/-/archive/develop/flaregun-develop.tar.gz && \
tar -xzf flaregun.tar.gz -C /work/ --strip-components=1 flaregun-develop/amqpfind && \
rm flaregun.tar.gz
# We're only using the root user, pip shouldn't warn about it
ENV PIP_ROOT_USER_ACTION=ignore
# Make sure scripts in .local are usable and pip doesn't warn about it
ENV PATH=/root/.local/bin:/work/geo2grid/bin:$PATH
# AWSCLI is not available as an RPM on RHEL8
RUN microdnf install -y findutils python-pip && \
pip install --user awscli && \
find /root/.local/lib/python3.9/site-packages/botocore/data/ -mindepth 1 -maxdepth 1 ! \( -name "*s3*" -o -name "*.json" \) -exec rm -rfv {} + && \
sed -E 's/^[^#]*\(event_handlers\)$/#&/' -i /root/.local/lib/python3.9/site-packages/awscli/handlers.py && \
sed -E 's/^#(.*s3.*\(event_handlers\))$/\1/' -i /root/.local/lib/python3.9/site-packages/awscli/handlers.py && \
sed -E 's/^#(.*scalar.*\(event_handlers\))$/\1/' -i /root/.local/lib/python3.9/site-packages/awscli/handlers.py && \
rm -rf /root/.local/lib/python3.9/site-packages/awscli/examples
RUN pip install --user pika==1.3.1
# Only this stage is seen in the final image.
FROM rockylinux:8
FROM rockylinux:9-minimal
# findutils for xargs, python3 for python3, gettext for envsubst, time for /usr/bin/time, python3-pip for installing aws cli, groff-base for aws cli help command
RUN dnf -y install findutils python39 python39-pip gettext time groff-base
RUN microdnf -y install findutils python gettext time
WORKDIR /work
RUN curl -L -o flaregun.tar.gz https://gitlab.ssec.wisc.edu/rayg/flaregun/-/archive/develop/flaregun-develop.tar.gz && \
tar -xzf flaregun.tar.gz -C /work/ --strip-components=1 flaregun-develop/amqpfind && \
rm flaregun.tar.gz
RUN pip3 install awscli pika==1.3.1
# Make sure scripts in .local are usable and pip doesn't warn about it
ENV PATH=/root/.local/bin:/work/geo2grid/bin:$PATH
COPY --from=setup /work /work
COPY --from=setup /root/.local /root/.local
COPY run.sh /work/.
COPY product_amqp.py /work/.
COPY etc/composites/*.yaml /work/geo2grid/etc/polar2grid/composites/
ENV PATH=$PATH:/work/geo2grid/bin
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment