powershell - Dockerfile RUN 在基于 Ubuntu 的映像上调用 powershell
问题描述
我的 Dockerfile 中有以下内容:
# setup powershell
# Download the Microsoft repository GPG keys
RUN wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb
# Register the Microsoft repository GPG keys
RUN dpkg -i packages-microsoft-prod.deb
# Update the list of products
RUN apt-get update && apt-get install -y \
libunwind8 \
libicu55 \
powershell
# Register Powershell repo
RUN powershell Register-PSRepository ...
根据我读过的所有内容,这应该可以工作,但是在docker build
(用敏感信息审查)期间我得到了以下输出。
Processing triggers for libc-bin (2.23-0ubuntu11) ...
Setting up liburcu4:amd64 (0.9.1-3) ...
Setting up liblttng-ust-ctl2:amd64 (2.7.1-1) ...
Setting up liblttng-ust0:amd64 (2.7.1-1) ...
Setting up powershell (7.0.0-1.ubuntu.16.04) ...
Processing triggers for libc-bin (2.23-0ubuntu11) ...
Removing intermediate container 1ef0413ecd13
---> a5323d6c8301
Step 12/23 : RUN powershell Register-PSRepository ...<snip>...
---> Running in 604784872cc8
/bin/sh: 1: powershell: not found
The command '/bin/sh -c powershell Register-PSRepository ...<snip>... returned a non-zero code: 127
我不知道为什么没有找到 powershell,apt-get install
因为它的呼吁是成功的。
powershell
使用成功安装后如何调用apt-get
?
解决方案
安装 powershell 后,您应该可以使用它来调用它
密码
推荐阅读
- java - DecimalFormat 如何更严格?
- javascript - toExpontial 在本机反应中未定义
- c# - ffmpeg 可能存在 sws_scale 内存泄漏
- range - how to use the evaluation function with determined last row in VBA
- python - numpy 布尔数组中每列至少有一个 True 值
- rust - 如何使用 Clap 指定布尔命令行标志?
- markdown - 如何在不编写中间 HTML 文件的情况下将 Markdown 转换为 PDF?
- haskell - Haskell 图中是否有容器类型?
- sql - 休息后重置 ROW_NUMBER()
- sql - 如果内部联接查询不存在,则 SQLite 选择查询