-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reorder Dockerfile for faster rebuild.
- Loading branch information
Showing
1 changed file
with
14 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
# nosemgrep:github.workflows.config.dockerfile-source-not-pinned | ||
FROM ubuntu:22.04 as installer | ||
ARG PIPCONF | ||
ENV PIPCONF=$PIPCONF | ||
COPY --from=iqtlabs/gamutrf-base:latest /usr/local /usr/local | ||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV PATH="${PATH}:/root/.local/bin" | ||
WORKDIR /gamutrf | ||
COPY gamutrf gamutrf/ | ||
COPY bin bin/ | ||
COPY templates templates/ | ||
COPY poetry.lock pyproject.toml README.md /gamutrf/ | ||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
# TODO: https://github.com/python-poetry/poetry/issues/3591 | ||
# Install pandas via pip to get wheel. Disabling the new installer/configuring a wheel source does not work. | ||
|
@@ -25,16 +22,18 @@ RUN apt-get update && apt-get install --no-install-recommends -y -q \ | |
python3-pip && \ | ||
curl -sSL https://install.python-poetry.org | python3 - --version 1.4.2 && \ | ||
poetry config virtualenvs.create false && \ | ||
python3 -m pip install --no-cache-dir --upgrade pip && \ | ||
poetry run pip install --no-cache-dir pandas==$(grep pandas pyproject.toml | grep -Eo "[0-9\.]+") && \ | ||
python3 -m pip install --no-cache-dir --upgrade pip | ||
WORKDIR /gamutrf | ||
COPY gamutrf gamutrf/ | ||
COPY bin bin/ | ||
COPY templates templates/ | ||
COPY poetry.lock pyproject.toml README.md /gamutrf/ | ||
RUN if [ "$PIPCONF" != "" ] ; then echo -e "$PIPCONF" > /etc/pip.conf ; fi | ||
RUN poetry run pip install --no-cache-dir pandas==$(grep pandas pyproject.toml | grep -Eo "[0-9\.]+") && \ | ||
poetry install --no-interaction --no-dev --no-ansi | ||
|
||
# nosemgrep:github.workflows.config.dockerfile-source-not-pinned | ||
FROM ubuntu:22.04 | ||
COPY --from=iqtlabs/gnuradio:3.10.8 /usr/share/uhd/images /usr/share/uhd/images | ||
COPY --from=installer /usr/local /usr/local | ||
COPY --from=installer /gamutrf /gamutrf | ||
COPY --from=installer /root/.local /root/.local | ||
LABEL maintainer="Charlie Lewis <[email protected]>" | ||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV UHD_IMAGES_DIR /usr/share/uhd/images | ||
|
@@ -81,6 +80,10 @@ RUN if [ "$(arch)" = "x86_64" ] ; then \ | |
wget \ | ||
zstd && \ | ||
apt-get -y -q clean && rm -rf /var/lib/apt/lists/* | ||
COPY --from=iqtlabs/gnuradio:3.10.8 /usr/share/uhd/images /usr/share/uhd/images | ||
COPY --from=installer /usr/local /usr/local | ||
COPY --from=installer /gamutrf /gamutrf | ||
COPY --from=installer /root/.local /root/.local | ||
WORKDIR /gamutrf | ||
RUN echo "$(find /gamutrf/gamutrf -type f -name \*py -print)"|xargs grep -Eh "^(import|from)\s"|grep -Ev "gamutrf"|sort|uniq|python3 | ||
RUN ldd /usr/local/bin/uhd_sample_recorder | ||
|