ubuntu镜像在docker中损坏,dpkg错误?[已关闭]

osh3o9ms  于 11个月前  发布在  Docker
关注(0)|答案(1)|浏览(110)

已关闭此问题为not about programming or software development。它目前不接受回答。

这个问题似乎不是关于a specific programming problem, a software algorithm, or software tools primarily used by programmers的。如果你认为这个问题与another Stack Exchange site的主题有关,你可以留下评论,解释在哪里可以回答这个问题。
昨天关门了。
Improve this question
我试图在Ubuntu镜像中安装python,nodejs和npm,我得到以下错误

125.4 debconf: Perl may be unconfigured (Debconf/Log.pm did not return a true value at (eval 1) line 4.
125.4 BEGIN failed--compilation aborted at (eval 1) line 4.
125.4 ) -- aborting
125.4 Fetched 242 MB in 1min 55s (2107 kB/s)
125.4 dpkg: error: corrupt info database format file '/var/lib/dpkg/info/format'
125.4 E: Sub-process /usr/bin/dpkg returned an error code (2)
------
Dockerfile:9
--------------------
   8 |     # Install required packages
   9 | >>> RUN apt update && \
  10 | >>>     apt install -y curl python3 python3-pip nodejs npm && \
  11 | >>>     rm -rf /var/lib/apt/lists/*
  12 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c apt update &&     apt install -y curl python3 python3-pip nodejs npm &&     rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 100

我不知道是什么导致了错误。
这里是DockerFile

# Use the ubuntu:latest base image
FROM ubuntu:latest

LABEL authors="bunty"

#ENV DEBIAN_FRONTEND=noninteractive

# Install required packages
RUN apt update && \
    apt install -y curl python3 python3-pip nodejs npm && \
    rm -rf /var/lib/apt/lists/*

# Set the working directory inside the container
WORKDIR /engine_api

# Copy the entire current directory (including subdirectories) to /engine_api in the container
COPY ./api/src /engine_api
COPY ./package.json ./package-lock.json /engine_api/
COPY ./my_engine_data/ ./my_engine_data
COPY ./public ./public

# Install Node.js dependencies
RUN npm install && \
    chmod -R +x ./my_engine_data/packages

RUN pip3 install numpy scipy pandas seaborn matplotlib scikit-learn

# Install the R package 'runit'
RUN R -e "install.packages('runit', dependencies=TRUE, repos='https://cran.rstudio.com/')"

# Set the command to run.sh the Node.js application
CMD node /engine_api/app.js

我在Macbook Air 2022中使用Docker。

dphi5xsq

dphi5xsq1#

您必须在错误行之前安装apt-transport-https软件包。

RUN apt-get update && apt-get install -y apt-transport-https

在安装之前尝试这一行

相关问题