Skip to content

Commit

Permalink
#7944: Remove multi-stage build
Browse files Browse the repository at this point in the history
  • Loading branch information
ttmchiou committed May 7, 2024
1 parent 65d6402 commit 55bf5ad
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions dockerfile/ubuntu-20.04-x86.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,28 @@
# First stage: just a space to preserve file metadata
FROM ubuntu:20.04 as builder
COPY scripts /scripts

# Second stage: the actual image
FROM ubuntu:20.04

ARG DEBIAN_FRONTEND=noninteractive
ENV GTEST_VERSION=1.13.0
ENV DOXYGEN_VERSION=1.9.6

# Copy installation scripts and files
COPY --from=builder /scripts /opt/tt_metal_infra/scripts
COPY --from=builder /usr/local/bin /usr/local/bin

# Install build and runtime deps
COPY /scripts/docker/requirements.txt /opt/tt_metal_infra/scripts/docker/requirements.txt
RUN apt-get -y update \
&& xargs -a /opt/tt_metal_infra/scripts/docker/requirements.txt apt-get install -y --no-install-recommends \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Install dev deps
COPY /scripts/docker/requirements_dev.txt /opt/tt_metal_infra/scripts/docker/requirements_dev.txt
RUN apt-get -y update \
&& xargs -a /opt/tt_metal_infra/scripts/docker/requirements_dev.txt apt-get install -y --no-install-recommends \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

## Test Related Dependencies
COPY /scripts/docker/install_test_deps.sh /opt/tt_metal_infra/scripts/docker/install_test_deps.sh
RUN /bin/bash /opt/tt_metal_infra/scripts/docker/install_test_deps.sh ${GTEST_VERSION} ${DOXYGEN_VERSION}

# Install smi
COPY scripts/install/ /opt/tt_metal_infra/scripts/install
RUN cd /opt/tt_metal_infra/scripts/install \
&& ./install_tt-smi.sh

Expand All @@ -40,4 +34,8 @@ RUN cd /opt/tt_metal_infra/scripts/install \
RUN cd /opt/tt_metal_infra/scripts/install \
&& ./install_tt-topology.sh

# Copy remaining convenience scripts
COPY /scripts /opt/tt_metal_infra/scripts
COPY build_metal.sh /scripts/build_metal.sh

CMD ["tail", "-f", "/dev/null"]

0 comments on commit 55bf5ad

Please sign in to comment.