支持多架构打包
This commit is contained in:
+35
-13
@@ -1,18 +1,40 @@
|
||||
FROM dockerproxy.com/library/ubuntu:22.04
|
||||
ADD dotnet-runtime-3.1.32-linux-x64.tar.gz /root/dotnet
|
||||
COPY libssl1.0.0_1.0.2g-1ubuntu4.20_amd64.deb /tmp
|
||||
FROM swr.cn-north-4.myhuaweicloud.com/cloud-yuzhen/ubuntu:22.04
|
||||
ARG TARGETARCH
|
||||
ARG ARCH32
|
||||
|
||||
RUN apt update;dpkg --add-architecture i386;apt update;apt install -y --no-install-recommends libstdc++6 lib32stdc++6 libc6:i386 libc6 libgcc-s1 libicu70 liblttng-ust1 zlib1g vim zip unzip wget openssh-server inetutils-ping inetutils-telnet;\
|
||||
dpkg -i /tmp/libssl1.0.0_1.0.2g-1ubuntu4.20_amd64.deb;\
|
||||
echo "PermitRootLogin yes\nPasswordAuthentication yes\n" >> /etc/ssh/sshd_config;\
|
||||
echo root:123456 |chpasswd
|
||||
RUN echo "当前构建架构: ${TARGETARCH}"
|
||||
RUN echo "当前构建32架构: ${ARCH32}"
|
||||
|
||||
COPY localtime /etc
|
||||
# 添加架构相关的依赖包
|
||||
ADD overlay/dotnet-runtime-3.1.32-linux-${TARGETARCH}.tar.gz /root/dotnet
|
||||
COPY overlay/libssl1.0.0_1.0.2g-1ubuntu4.20_${TARGETARCH}.deb /tmp
|
||||
|
||||
# 动态处理架构兼容性
|
||||
RUN apt update && \
|
||||
dpkg --add-architecture ${ARCH32} && \
|
||||
apt update && \
|
||||
apt install -y --no-install-recommends \
|
||||
libstdc++6 \
|
||||
# lib32stdc++6 \
|
||||
libstdc++6:${ARCH32} \
|
||||
libc6:${ARCH32} \
|
||||
libc6 \
|
||||
libgcc-s1 \
|
||||
libicu70 \
|
||||
liblttng-ust1 \
|
||||
zlib1g \
|
||||
vim \
|
||||
zip \
|
||||
unzip \
|
||||
wget \
|
||||
openssh-server \
|
||||
inetutils-ping \
|
||||
inetutils-telnet && \
|
||||
dpkg -i /tmp/libssl1.0.0_1.0.2g-1ubuntu4.20_${TARGETARCH}.deb && \
|
||||
echo "PermitRootLogin yes\nPasswordAuthentication yes\n" >> /etc/ssh/sshd_config && \
|
||||
echo root:123456 | chpasswd
|
||||
|
||||
COPY overlay/localtime /etc
|
||||
COPY prog /home/
|
||||
|
||||
WORKDIR /home
|
||||
|
||||
CMD ["/home/start.sh"]
|
||||
|
||||
|
||||
CMD ["/home/start.sh"]
|
||||
Reference in New Issue
Block a user