gpt4 book ai didi

Docker 构建错误 : The command '/bin/sh -c apt-get install –y apache2' returned a non-zero code: 100

转载 作者:行者123 更新时间:2023-12-05 00:58:57 29 4
gpt4 key购买 nike

我正在尝试构建一个 Dockerfile

FROM ubuntu 
RUN apt-get update
RUN apt-get install –y apache2
RUN apt-get install –y apache2-utils
RUN apt-get clean
EXPOSE 80
CMD [“apache2ctl”, “-D”, “FOREGROUND”]

当我运行此命令时 docker build –t=”mywebserver” . 我在控制台中遇到以下提供的错误

E: Unable to locate package –y
The command '/bin/sh -c apt-get install –y apache2' returned a non-zero code: 100

最佳答案

我不知道怎么做,但我认为您在 y 前面使用的是破折号而不是连字符。

你想要 -y 而不是 -y

如果仔细观察,会有细微差别。

关于Docker 构建错误 : The command '/bin/sh -c apt-get install –y apache2' returned a non-zero code: 100,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55240167/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com