gpt4 book ai didi

Docker 容器无法定位 Zip 包?

转载 作者:行者123 更新时间:2023-12-04 02:16:05 36 4
gpt4 key购买 nike

所有 Ubuntu wiley 存储库都添加到我的 Dockerfile 中,即 main , universe等,并出现在我的 docker 镜像中。然而,apt-get install在以下 Dockerfile 中无法找到任何 ZIP/UnZIP 包。错误日志在最后。

如何安装这些常见的 zip 包?至少 p7zip-fullrar .

Dockerfile

FROM ubuntu:15.10
CMD ["bash"]
RUN add-apt-repository main && \
add-apt-repository universe && \
add-apt-repository restricted && \
add-apt-repository multiverse
RUN apt-get update -y && \
apt-get upgrade -y && \
apt-get dist-upgrade -y && \
apt-get -y autoremove && \
apt-get clean
RUN apt-get install p7zip \
p7zip-full \
p7zip-rar \
unace \
unrar \
zip \
unzip \
xz-utils \
sharutils \
rar \
uudeview \
mpack \
arj \
cabextract \
file-roller \
&& rm -rf /var/lib/apt/lists/*

错误抛出
E: Unable to locate package p7zip-full
E: Unable to locate package unace
E: Unable to locate package unrar
E: Unable to locate package zip
E: Unable to locate package unzip
E: Unable to locate package sharutils
E: Unable to locate package rar
E: Unable to locate package uudeview
E: Unable to locate package mpack
E: Unable to locate package arj
E: Unable to locate package cabextract
E: Unable to locate package file-roller

最佳答案

尝试使用此 Dockerfile (您的 Dockerfile 没有我在之前的评论中告诉您的内容):

FROM ubuntu:15.10
RUN apt-get update -y && \
apt-get upgrade -y && \
apt-get dist-upgrade -y && \
apt-get -y autoremove && \
apt-get clean
RUN apt-get install -y p7zip \
p7zip-full \
unace \
zip \
unzip \
xz-utils \
sharutils \
uudeview \
mpack \
arj \
cabextract \
file-roller \
&& rm -rf /var/lib/apt/lists/*

CMD ["bash"]

它可以工作并安装 zip 和 p7zip
$ docker build -t mytest .
$ docker run -d -ti --name mytest mytest /bin/bash
$ docker exec -ti mytest /bin/bash

root@f01fc3456a2a:/# zip
root@f01fc3456a2a:/# p7zip

关于Docker 容器无法定位 Zip 包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41651145/

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