简体   繁体   中英

Windows docker build warning non-windows docker host

I am trying to build a docker image from a docker client (Windows) running this command:

docker --host a.b.c.d build --no-cache=true --build-arg CONFIGURATION=live -t imagename .

The docker host is also a Windows Docker but I get this error:

SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.

And then this one after the first attempt:

invalid character '<' looking for beginning of value

Anyone know why this happen? I had no error before, the only differences are in the code source. For information I am using Jenkins to build the project? Thanks.

UPDATE 1 - Dockerfile

FROM microsoft/windowsservercore
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]

ARG CONFIGURATION
EXPOSE 80
ADD src/MyFolder/bin/$CONFIGURATION/ /ContainerFolder
CMD /ContainerFolder/MyApp.exe

From thaJeztah on GitHub :

That warning was added, because the Windows filesystem does not have an option to mark a file as 'executable'. Building a linux image from a Windows machine would therefore break the image if a file has to be marked executable.

For that reason, files are marked executable by default when building from a windows client; the warning is there so that you are notified of that, and (if needed), modify the Dockerfile to change/remove the executable bit afterwards.

This is fixed now. The problem was in the Gateway Firewall, it was detecting a file sent in the build context as a Trojan. Probably Docker build context zip file or use different extensions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM