Dockerfile在不同机器上的行为不同

时间:2019-10-02 08:39:47

标签: docker dockerfile

我遇到了一个看似不可能的情况:我正在使用以下Dockerfile构建.Net应用程序:

SELECT
`ps_orders`.`id_order`, 
`ps_customer`.`firstname`,
`ps_customer`.`lastname`,
`ps_customer`.`email`,
`ps_address`.`address1`,
`ps_address`.`postcode`,
`ps_address`.`city`,
`ps_address`.`phone_mobile`,
`ps_orders`.`id_order`,
`ps_orders`.`reference`,
`ps_order_detail`.`product_name`,
`ps_order_detail`.`product_quantity`,
`ps_shop`.`name` AS `tienda`,
`ps_carrier`.`name` AS `transportista`
 FROM
`ps_customer`
 INNER JOIN `ps_address` ON `ps_customer`.`id_customer` = 
 `ps_address`.`id_customer`
 INNER JOIN `ps_orders` ON `ps_address`.`id_customer` = 
 `ps_orders`.`id_customer`
 AND `ps_address`.`id_address` = ps_orders.id_address_delivery
 INNER JOIN `ps_order_detail` ON `ps_orders`.`id_order` = 
`ps_order_detail`.`id_order`
 INNER JOIN `ps_shop` ON `ps_order_detail`.`id_shop` = 
`ps_shop`.`id_shop`
 INNER JOIN `ps_carrier` ON `ps_orders`.`id_carrier` = 
`ps_carrier`.`id_carrier`
 WHERE
`ps_orders`.`id_order` = 11389

我的构建命令是

FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 AS netbuild
WORKDIR /app

COPY . ./

RUN dotnet publish -c Debug -o out

FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019
WORKDIR /app

COPY --from=netbuild /app/MyProject/out .

#Some other things and an entrypoint

在我的本地计算机上,这可以很好地工作。但是,当我在用作构建代理的另一台计算机上运行它时,dotnet publish决定将构建结果放入 C:\ app \ out 而不是 C:\ app \ MyProject \ out

现在,我已经读到相对路径的 -o 选项的行为在某些版本的构建工具中已更改,但这是一个Dockerfile,因此不会产生任何影响。此外,两台机器都运行Win 10 Pro,并且安装了最新的Docker。

0 个答案:

没有答案