gpt4 book ai didi

docker - 错误/dev/tty : No such device or address when installing sqlcmd inside docker

转载 作者:行者123 更新时间:2023-12-04 19:32:48 26 4
gpt4 key购买 nike

我想在我的 docker 镜像中安装 sql cmd。
我的 dockerfile 有这些命令来安装 sqlcmd(centos 7 基础镜像)

RUN curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/msprod.repo
RUN yum remove mssql-tools unixODBC-utf16-devel
RUN yum install -y unixODBC-devel mssql-tools

下面是docker构建日志
Transaction test succeeded
Running transaction
Updating : libcom_err-1.42.9-17.el7.x86_64 1/14
Installing : unixODBC-2.3.7-1.rh.x86_64 2/14
Updating : libss-1.42.9-17.el7.x86_64 3/14
Installing : e2fsprogs-libs-1.42.9-17.el7.x86_64 4/14
Installing : e2fsprogs-1.42.9-17.el7.x86_64 5/14
Updating : 1:openssl-libs-1.0.2k-19.el7.x86_64 6/14
Installing : 1:make-3.82-24.el7.x86_64 7/14
Installing : 1:openssl-1.0.2k-19.el7.x86_64 8/14
/var/tmp/rpm-tmp.8S1dKq: line 17: /dev/tty: No such device or address
error: %pre(msodbcsql17-17.5.2.1-1.x86_64) scriptlet failed, exit status 1
Error in PREIN scriptlet in rpm package msodbcsql17-17.5.2.1-1.x86_64
error: msodbcsql17-17.5.2.1-1.x86_64: install failed
/var/tmp/rpm-tmp.tObfQB: line 4: /dev/tty: No such device or address
error: %pre(mssql-tools-17.5.2.1-1.x86_64) scriptlet failed, exit status 1
Error in PREIN scriptlet in rpm package mssql-tools-17.5.2.1-1.x86_64
Installing : unixODBC-devel-2.3.7-1.rh.x86_64 11/14
error: mssql-tools-17.5.2.1-1.x86_64: install failed
Cleanup : 1:openssl-libs-1.0.2k-8.el7.x86_64 12/14
Cleanup : libss-1.42.9-10.el7.x86_64 13/14
Cleanup : libcom_err-1.42.9-10.el7.x86_64 14/14
Verifying : libss-1.42.9-17.el7.x86_64 1/14

当我使用 docker exec 在容器终端内手动运行此安装命令时,它工作正常。
如果我直接在 linux 机器上运行这个命令,它工作正常。
仅当我使用 docker build 构建 docker 镜像时,我才收到错误/dev/tty: No such device or address

最佳答案

尝试:
RUN ACCEPT_EULA=Y yum install -y unixODBC-devel mssql-tools

关于docker - 错误/dev/tty : No such device or address when installing sqlcmd inside docker,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61555981/

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