簡體   English   中英

在Windows 10中瀏覽Docker容器

[英]Browsing a docker container in windows 10

我使用用於Windows的docker創建了一個映像並將其部署到本地,但是出現一個錯誤,即找不到某個文件。 構建可能是有問題的,所以我想我將看到容器的文件來解決此問題並避免將來出現任何問題。

我嘗試使用以下方法在docker上運行powershell

docker run -it node-web-app powershell

但我得到一個錯誤

C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from 
daemon: OCI runtime create failed: container_linux.go:348: starting 
container process caused "exec: \"powershell\": executable file not found in 
$PATH": unknown.

任何人都對此有經驗,可以指出正確的方向嗎?

我的碼頭工人文件:

# Create container with node and npm preinstalled
FROM node:latest

# Create app directory
WORKDIR /app

# Install app dependencies
COPY package*.json ./
RUN npm install --only=production

# Bundle app source
COPY . .

# Bind to port 8080
EXPOSE 8080

# Run the server
CMD [ "npm", "run", "start-prod" ]

您的dockerfile聲明您已從node:latest構建了映像。 現在,如果您訪問https://hub.docker.com/_/node/上的docker hub,您將看到node:latest映像的詳細信息。

這將帶您到https://github.com/nodejs/docker-node/blob/9023f588717d236a92d91a8483ff0582484c22d1/9/Dockerfile

在此dockerfile您將看到它是從buildpack-deps:jessie構建的。 基本上,這是一個debian映像,這意味着它將沒有powershell。 因此,正如@ fly2matrix指出的那樣,錯誤非常清楚地表明,容器內的PATH變量中沒有名為powershell可執行文件。

此錯誤意味着Powershell可執行文件在您的容器中不可用。

我假設您的基本映像是Linux,而不是Windows。 查找Dockerfile的FROM語句。

您能否分享您的Dockerfile來確定真正的問題?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM