11# Stage 1: Temporary image for amd64 dependencies
2- FROM docker.io/amd64/ubuntu:22.04 as ld-prefix
2+ FROM docker.io/amd64/ubuntu:22.04 AS ld-prefix
33ENV DEBIAN_FRONTEND=noninteractive
44
55# Install amd64-specific dependencies
@@ -9,11 +9,19 @@ RUN apt-get update && apt-get -y install \
99 libssl3
1010
1111# Stage 2: Main image for ppc64le Ubuntu
12- FROM --platform=linux/ppc64le ubuntu:22.04
12+ FROM ubuntu:22.04
1313
1414# Set non-interactive mode for apt
1515ENV DEBIAN_FRONTEND=noninteractive
1616
17+ # Fix sources to point to ports.ubuntu.com for ppc64le
18+ RUN sed -i 's|archive.ubuntu.com|ports.ubuntu.com|g' /etc/apt/sources.list && \
19+ sed -i 's|security.ubuntu.com|ports.ubuntu.com|g' /etc/apt/sources.list
20+
21+ # Update and clean apt
22+ RUN apt-get update -o Acquire::Retries=3 && \
23+ apt-get clean && rm -rf /var/lib/apt/lists/*
24+
1725# Install dependencies for building and testing PyTorch
1826RUN apt-get update && apt-get -y install --no-install-recommends \
1927 build-essential \
@@ -42,31 +50,31 @@ RUN apt-get update && apt-get -y install --no-install-recommends \
4250 ca-certificates \
4351 && apt-get clean && rm -rf /var/lib/apt/lists/*
4452
45- # Copy amd64 dependencies from the ld-prefix stage
46- COPY --from=ld-prefix / /usr/x86_64-linux-gnu/
47- RUN ln -fs ../lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 /usr/x86_64-linux-gnu/lib64/
48- RUN ln -fs /etc/resolv.conf /usr/x86_64-linux-gnu/etc/
49- ENV QEMU_LD_PREFIX=/usr/x86_64-linux-gnu
50-
51- # Copy custom scripts
52- COPY fs/ /
53- RUN chmod +x /usr/bin/actions-runner /usr/bin/entrypoint
54-
55- # Install Docker Engine for ppc64le
56- RUN apt-get update && apt-get install -y \
53+ # Fix: Add Docker Engine repository correctly for ppc64le
54+ RUN apt-get update && apt-get install -y --no-install-recommends \
5755 apt-transport-https \
5856 ca-certificates \
5957 curl \
6058 gnupg-agent \
6159 software-properties-common \
6260 && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
6361 && echo "deb [arch=ppc64el] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list \
64- && apt-get update && apt-get install -y \
62+ && apt-get update -o Acquire::Retries=3 && apt-get install -y \
6563 docker-ce \
6664 docker-ce-cli \
6765 containerd.io \
6866 && apt-get clean && rm -rf /var/lib/apt/lists/*
6967
68+ # Copy amd64 dependencies from the ld-prefix stage
69+ COPY --from=ld-prefix / /usr/x86_64-linux-gnu/
70+ RUN ln -fs ../lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 /usr/x86_64-linux-gnu/lib64/
71+ RUN ln -fs /etc/resolv.conf /usr/x86_64-linux-gnu/etc/
72+ ENV QEMU_LD_PREFIX=/usr/x86_64-linux-gnu
73+
74+ # Copy custom scripts
75+ COPY fs/ /
76+ RUN chmod +x /usr/bin/actions-runner /usr/bin/entrypoint
77+
7078# Configure GitHub Actions Runner for amd64
7179RUN useradd -m actions-runner
7280USER actions-runner
0 commit comments