在我自己的机器(Windows 10,Desktop 2.1.0.3)上,构建成功并运行。在另一台计算机(Ubuntu18.04,docker 19.03.13)上,生成失败,并显示错误。
为什么构建在一台机器上工作,而在另一台机器上失败?
码头文件:
FROM ubuntu:latest AS toolchain
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
build-essential \
g++-5错误:
Package g++-5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
gcc-10-test-results gcc-9-test-results gcc-8-test-results gcc-7-test-results
Package 'g++-5' has no installation candidate
The command '/bin/sh -c apt-get update && apt-get install -y build-essential g++-5' returned a non-zero code: 100发布于 2020-10-17 20:42:00
问题似乎在于,ubuntu:最新的图像已经过时。改为ubuntu:仿生修复了这个问题:
FROM ubuntu:bionic AS toolchain
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
build-essential \
g++-5我不知道为什么要用旧的图像,但这似乎是另一个问题。
https://devops.stackexchange.com/questions/12586
复制相似问题