Skip to content

Commit 3f9c4ac

Browse files
committed
Modified to generate a reduced final version (using multi-stage)
1 parent 3d0686c commit 3f9c4ac

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

recipes/synthesis

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,44 @@ RUN apt update -qq \
3030
RUN git clone --depth 1 https://github.com/ghdl/ghdl \
3131
&& mkdir ghdl/build && cd ghdl/build \
3232
&& ../configure --prefix=/usr/local \
33-
&& make -j$(nproc) && make install \
34-
&& cd /root && rm -fr ghdl
33+
&& make -j$(nproc) && make install
3534

3635
#
3736
# Yosys
3837
#
3938

4039
RUN git clone --depth 1 https://github.com/YosysHQ/yosys \
4140
&& cd yosys && git submodule update --init \
42-
&& make -j$(nproc) && make install \
43-
&& cd /root && rm -fr yosys
41+
&& make -j$(nproc) && make install
4442

4543
#
4644
# ghdl-yosys-plugin
4745
#
4846

4947
RUN git clone --depth 1 https://github.com/ghdl/ghdl-yosys-plugin.git \
5048
&& cd ghdl-yosys-plugin && git submodule update --init \
51-
&& make -j$(nproc) && make install \
52-
&& cd /root && rm -fr ghdl-yosys-plugin
49+
&& make -j$(nproc) && make install
50+
51+
#
52+
# Clean-up
53+
#
54+
55+
RUN cd /usr/local/lib && rm -fr libghdlvpi.so libghw.so python3.* \
56+
&& cd /usr/local/bin && rm ghwdump yosys-filterlib yosys-smtbmc yosys-witness
57+
58+
###############################################################################
59+
60+
FROM ubuntu:latest
61+
#gcr.io/distroless/static-debian12
62+
63+
RUN apt update -qq \
64+
&& DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
65+
libreadline-dev \
66+
tcl-dev \
67+
&& apt autoclean && apt clean && apt -y autoremove \
68+
&& rm -rf /var/lib/apt/lists/*
69+
70+
COPY --from=build /usr/local/bin /usr/local/bin
71+
COPY --from=build /usr/local/lib /usr/local/lib
72+
COPY --from=build /usr/local/include/ghdl /usr/local/include/ghdl
73+
COPY --from=build /usr/local/share/yosys /usr/local/share/yosys

0 commit comments

Comments
 (0)