diff --git a/dockerfiles/Dockerfile.langutils b/dockerfiles/Dockerfile.langutils index 120fa5d..bc38106 100644 --- a/dockerfiles/Dockerfile.langutils +++ b/dockerfiles/Dockerfile.langutils @@ -96,16 +96,20 @@ RUN apt-get install -y --no-install-recommends \ RUN cargo install --root /usr/local --git https://github.com/dalance/svlint.git svlint # -# Optimization +# Optimization and clean-up # RUN strip /usr/local/bin/* 2>/dev/null || true -RUN find /usr/local/lib -name "*.so*" -exec strip --strip-unneeded {} + 2>/dev/null || true +RUN find /usr/local/lib -name "*.a" -delete \ + && find /usr/local/lib -name "*.so" -delete \ + && rm -rf /usr/local/lib/cmake /usr/local/*/pkgconfig #------------------------------------------------------------------------------ FROM ubuntu:latest AS runtime -COPY --from=builder /usr/local /usr/local +COPY --from=builder /usr/local/bin /usr/local/bin +COPY --from=builder /usr/local/lib /usr/local/lib +COPY --from=builder /usr/local/share /usr/local/share RUN ldconfig diff --git a/dockerfiles/Dockerfile.nextpnr-apicula b/dockerfiles/Dockerfile.nextpnr-apicula index 0fbd67f..31966d9 100644 --- a/dockerfiles/Dockerfile.nextpnr-apicula +++ b/dockerfiles/Dockerfile.nextpnr-apicula @@ -39,10 +39,12 @@ RUN cd nextpnr && git submodule update --init --recursive \ && make -j$(nproc) && make install # -# Optimization +# Optimization and clean-up # RUN strip /usr/local/bin/* 2>/dev/null || true +RUN find /usr/local/lib -name "*.a" -delete \ + && rm -rf /usr/local/lib/cmake /usr/local/*/pkgconfig #------------------------------------------------------------------------------ @@ -52,6 +54,8 @@ RUN apt-get update -qq && apt-get install -y --no-install-recommends \ python3 \ && rm -rf /var/lib/apt/lists/* -COPY --from=builder /usr/local /usr/local +COPY --from=builder /usr/local/bin /usr/local/bin +COPY --from=builder /usr/local/lib /usr/local/lib +COPY --from=builder /usr/local/share /usr/local/share RUN ldconfig diff --git a/dockerfiles/Dockerfile.nextpnr-icestorm b/dockerfiles/Dockerfile.nextpnr-icestorm index 11af780..063bf0a 100644 --- a/dockerfiles/Dockerfile.nextpnr-icestorm +++ b/dockerfiles/Dockerfile.nextpnr-icestorm @@ -36,15 +36,19 @@ RUN cd nextpnr && git submodule update --init --recursive \ && make -j$(nproc) && make install # -# Optimization +# Optimization and clean-up # RUN strip /usr/local/bin/* 2>/dev/null || true +RUN find /usr/local/lib -name "*.a" -delete \ + && rm -rf /usr/local/lib/cmake /usr/local/*/pkgconfig #------------------------------------------------------------------------------ FROM ubuntu:latest AS runtime -COPY --from=builder /usr/local /usr/local +COPY --from=builder /usr/local/bin /usr/local/bin +COPY --from=builder /usr/local/lib /usr/local/lib +COPY --from=builder /usr/local/share /usr/local/share RUN ldconfig diff --git a/dockerfiles/Dockerfile.nextpnr-trellis b/dockerfiles/Dockerfile.nextpnr-trellis index 59439fb..860bfab 100644 --- a/dockerfiles/Dockerfile.nextpnr-trellis +++ b/dockerfiles/Dockerfile.nextpnr-trellis @@ -38,15 +38,19 @@ RUN cd nextpnr && git submodule update --init --recursive \ && make -j$(nproc) && make install # -# Optimization +# Optimization and clean-up # RUN strip /usr/local/bin/* 2>/dev/null || true +RUN find /usr/local/lib -name "*.a" -delete \ + && rm -rf /usr/local/lib/cmake /usr/local/*/pkgconfig #------------------------------------------------------------------------------ FROM ubuntu:latest AS runtime -COPY --from=builder /usr/local /usr/local +COPY --from=builder /usr/local/bin /usr/local/bin +COPY --from=builder /usr/local/lib /usr/local/lib +COPY --from=builder /usr/local/share /usr/local/share RUN ldconfig diff --git a/dockerfiles/Dockerfile.simulation b/dockerfiles/Dockerfile.simulation index 1c992a3..dd90e26 100644 --- a/dockerfiles/Dockerfile.simulation +++ b/dockerfiles/Dockerfile.simulation @@ -68,11 +68,12 @@ RUN apt-get install -y --no-install-recommends \ RUN python3 -m venv /opt/venv && /opt/venv/bin/pip install --no-cache-dir cocotb # -# Optimization +# Optimization and clean-up # RUN strip /usr/local/bin/* 2>/dev/null || true -RUN find /usr/local/lib -name "*.so*" -exec strip --strip-unneeded {} + 2>/dev/null || true +RUN find /usr/local/lib -name "*.a" -delete \ + && rm -rf /usr/local/lib/cmake /usr/local/*/pkgconfig #------------------------------------------------------------------------------ @@ -89,7 +90,9 @@ RUN apt-get update -qq && apt-get install -y --no-install-recommends \ zlib1g \ && rm -rf /var/lib/apt/lists/* -COPY --from=builder /usr/local /usr/local +COPY --from=builder /usr/local/bin /usr/local/bin +COPY --from=builder /usr/local/lib /usr/local/lib +COPY --from=builder /usr/local/share /usr/local/share COPY --from=builder /opt/venv /opt/venv RUN ldconfig diff --git a/dockerfiles/Dockerfile.synthesis b/dockerfiles/Dockerfile.synthesis index c83c08e..56bf961 100644 --- a/dockerfiles/Dockerfile.synthesis +++ b/dockerfiles/Dockerfile.synthesis @@ -73,6 +73,14 @@ RUN cd synlig \ && sed -i '1s/^/#include \n/' third_party/yosys/libs/json11/json11.cpp \ && make install -j$(nproc) +# +# Optimization and clean-up +# + +RUN strip /usr/local/bin/* 2>/dev/null || true +RUN find /usr/local/lib -name "*.a" -delete \ + && rm -rf /usr/local/lib/cmake /usr/local/*/pkgconfig + #------------------------------------------------------------------------------ FROM ubuntu:latest AS runtime @@ -84,6 +92,8 @@ RUN apt-get update -qq && apt-get install -y --no-install-recommends \ libreadline-dev \ && rm -rf /var/lib/apt/lists/* -COPY --from=builder /usr/local /usr/local +COPY --from=builder /usr/local/bin /usr/local/bin +COPY --from=builder /usr/local/lib /usr/local/lib +COPY --from=builder /usr/local/share /usr/local/share RUN ldconfig