问题标签 [windows-container]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
4 回答
2633 浏览

powershell - 检测进程是否在 Windows 容器内执行

这很简单。我想用代码检测我的进程是否在Windows容器中运行。有一些例子,但它们都适用于基于 linux 的容器。

我正在寻找对 docker 来说独特且明确的东西,它可以用来得出一个安全的结论,一个进程是否在容器托管的 Windows 操作系统中执行,而不是在其他情况下。

我的首选语言是 PowerShell,但如果有人指出如何检测,我会将其移植到 PowerShell。

0 投票
1 回答
167 浏览

asp.net-mvc - 将 asp.net mvc 网站发布到 windows 容器给出错误

我正在尝试将基本 mvc 站点发布到 Windows 容器。尝试以分离模式运行图像时出现错误。当我运行以下命令时,我能够构建图像并且可以看到图像

运行图像的命令

我跑步时遇到的错误是

docker:来自守护进程的错误响应:容器 c0899809... 在启动期间遇到错误:Windows 系统调用失败:操作超时,因为未从托管容器的虚拟机收到响应。(0xc0370109)。

码头工人信息

0 投票
2 回答
2835 浏览

windows - Docker DNS for Service Discovery to resolve Windows Container´s address by name does not work consistently

Working with Docker Windows Containers I want to go beyond only one Docker container running a App. As described in the Microsoft docs under the headline "Docker Compose and Service Discovery":

Built in to Docker is Service Discovery, which handles service registration and name to IP (DNS) mapping for containers and services; with service discovery, it is possible for all container endpoints to discover each other by name (either container name, or service name).

And because docker-compose lets you define services in it´s yaml files, these should be discoverable (e.g. pingable) by there names (be sure to remind the difference between services and containers in docker-compose). This blog post by Microsoft provides a complete example with the service web and db including full source with the needed docker-compose.yml in the GitHub repo.

My problem is: the Docker windows containers do "find" each other only sometimes, and sometimes not at all. I checked them with docker inspect <container-id> and the alias db and web are present there. But when I powershell into one container (e.g. into one web container via docker exec -it myapps_web_1 powershell) and try to do a ping db this only works only occasionally.

And let me be clear here (because IMHO the docs are not): This problem is the same for non docker-compose scenarios. Building an example app without compose, the problem also appears without docker-compose services, but just plain old container names!

Any ideas on that strange behavior? For me this scenario gets worse with more apps coming into play. For more details, just have a look into https://github.com/jonashackt/spring-cloud-netflix-docker, where I have an example project with Spring Boot & Spring Cloud Eureka/Zuul and 4 docker-compose services, where the weatherbackend and weatherbackend-second are easily scalable - e.g. via docker compose scale weatherbackend=3.

My Windows Vagrant box is build via packer.io and is based on the latest Windows Server 2016 Evalutation ISO. The necessary Windows Features and Docker/docker-compose installation is done with Ansible.

Having no fix for this problem, Docker Windows Containers become mostly unusable for us at the customer.

0 投票
0 回答
1677 浏览

tomcat - 在 Windows server 2016 Docker 容器上运行部署在 Tomcat 上的 Java 战争文件

尝试在 Windows server 2016 上使用 Docker 运行 Java .war 文件。

对于 Linux 容器,可以通过拉取 Tomcat 镜像(构建在 openJDK 之上并使用 Debian 作为基础镜像)并通过Dockerfile将 war 文件添加到webapps文件夹来完成。

但是,Tomcat 目前没有任何适用于 Windows 容器的镜像,因为 openJDK 也不支持Microsoft/windowsservercoreMicrosoft/nanoserver

在我看来,为了能够在 Tomcat for windows 上运行战争,我们需要:

  • windows服务器核心
  • JDK:JRE 安装在 windowsservercore 之上
  • 使用已安装 JDK 的环境变量安装 Tomcat。

要创建最终映像,请通过 PS 下载并安装 JDK:

Dockerfile 看起来像:

但我不确定如何安装 Tomcat 并设置环境变量,然后将 war 添加到 webapps 目录。

听说过WinDocks,但我想在没有它的情况下构建。

有人对此有一些见解吗?

0 投票
1 回答
6538 浏览

powershell - 在 Windows 容器上使用复杂的 powershell 脚本构建 Dockerfile

我正在尝试使用运行 powershell 的 dockerfile 构建 docker 映像。嵌入式 powershell 脚本已经在 dockerfile 之外进行了测试,但是在运行 dockerfile 时会出现错误。

从码头文件:

我收到以下错误:

该脚本的目的是将新内容添加到配置文件的特定行

知道语法有什么问题吗?

0 投票
0 回答
577 浏览

azure - Azure Service Fabric - 适用于 Windows 容器上托管的应用程序的 HTTP 504

我使用“Windows 2016 DataCenter with Containers”操作系统创建了一个 Azure Service Fabric 集群,并在集群的 80 端口上启用了反向代理侦听。我已经在这个集群上部署了一个示例容器应用程序。

我可以通过公共负载均衡器访问它,但是当我尝试通过反向代理访问它时,我会收到随机的 HTTP 504(网关超时)错误。

是否有人在通过反向代理访问容器托管应用程序时遇到 504 超时错误?任何帮助将不胜感激。

谢谢, 高拉夫

0 投票
2 回答
714 浏览

azure - Azure Service Fabric Windows 容器 - 容器间通信

我使用“Windows 2016 DataCenter with Containers”操作系统创建了一个 Azure Service Fabric 集群,并在集群的 80 端口上启用了反向代理侦听。我们打算在此集群上部署我们的旧版 ASP.NET MVC 和 WCF 应用程序。

在我们现有的部署模型中,由于聊天通信和低延迟要求,我们有位于同一主机上的服务相互通信。windows 容器中托管的应用程序是否可以与同一节点上的其他 windows 容器应用程序通信?基本上,我希望在同一个 Service Fabric 节点上的两个 Windows 容器应用程序之间具有节点关联性。

我用一个示例应用程序进行了尝试,看起来唯一的选择是使用动态分配的容器的私有 IP。在 Service Fabric 群集上实例化容器时是否可以传递 --ip-address 参数?

[更新:2017 年 4 月 5 日]

Service Fabric 群集版本:5.5.219.0

总节点类型:1

节点总数:3

两个容器都部署在所有三个节点上。Azure Internet 负载均衡器用于公开 Service Fabric 反向代理。所有服务都通过反向代理在内部和外部访问。

高拉夫

0 投票
1 回答
1585 浏览

sql-server - 为什么官方 SQL Server Express 容器仅用于开发和测试?

这里说...

预期用途:仅用于开发和测试。生产环境不支持

生产数据库是否应该不由容器托管,或者这是关于 Express 版本的建议,无论它是否在容器中?

0 投票
3 回答
3687 浏览

node.js - 在 microsoft/nanoserver 上 Dockerizing 一个 Node.js 应用程序

我是 Docker 新手。我们有一个基于节点的 REST 服务,我正在尝试创建一个 docker 映像,以便可以轻松地将服务部署到构建代理上。我有 CD 到我们有服务的 package.json 的文件夹,并添加到 docker 文件下面。我在 Win 10 build 14xxxx 上并使用 Docker windows 容器。我是否需要先提取节点映像并将其安装在 nanoserver 上?

当我跑

我得到以下错误

下面是完整的输出

先谢谢了

0 投票
1 回答
3389 浏览

windows - 在 docker throw {}->unix://localhost:80 中使用 maven 构建:没有这样的文件或目录

我有一个问题,因为这几天我以前没有。当我./mvnw -Pprod package -DskipTests=true docker:build在我的容器中启动时,我有这个日志

但是,如果我在没有生产标志的情况下启动构建,我就没有问题./mvnw -DskipTests=true docker:build

为什么我不能docker:build在我的容器中使用?

谢谢