包 unixodbc-bin 不可用,但被另一个包引用

Package unixodbc-bin is not available, but is referred to by another package

我按照这个答案是为了能够使用 Google 控制台云 运行 连接到外部 SQL 服务器。 ()

但是,我在部署时收到以下错误

Package unixodbc-bin 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
[91mE: Package 'unixodbc-bin' has no installation candidate
[0m
unable to stream build output: The command '/bin/sh -c apt-get install unixodbc-bin -y' returned a non-zero code: 100
Failed to build the app. Error: unable to stream build output: The command '/bin/sh -c apt-get install unixodbc-bin -y' returned a non-zero code: 100

Docker 文件:

# Python image to use.
FROM python:3.7

# Set the working directory to /app
WORKDIR /app

# copy the requirements file used for dependencies
COPY requirements.txt .

ADD odbcinst.ini /etc/odbcinst.ini
RUN apt-get update 
RUN apt-get install -y tdsodbc unixodbc-dev 
RUN apt-get install unixodbc-bin -y 
RUN apt-get clean -y 

#....etc

我还创建了 odbcinst.ini 文件,如下所述:

它使用的 Python 图像是 3.7

如有任何帮助,我们将不胜感激!

我运行遇到了同样的问题。用 unixodbc 替换 unixodbc-bin 解决了我的问题。