Docker Community Forums

Share and learn in the Docker community.

How do i run an executable inside a container (Day 3 of Docker Life)

I’ve tried a number of different ways to config the Dockerfile but none of them are working.
These are a few of the ways i’ve tried to get this done but, i’m obviously missing something
NOTE: i had to remove the FROM links because i’m a new user and only allow to make a post with two links.

FROM mcr.microsoft.com/windows:10.0.19042.1110-amd64
WORKDIR /TestFolder
COPY ./Binaries .
RUN ["ColorConsole.exe", "--help"]

LOG OUTPUT:
Error response from daemon: configured logging driver does not support reading

FROM 
COPY ./Binaries ./TestFolder/
WORKDIR /TestFolder
RUN ["ColorConsole.exe", "--help"]

LOG OUTPUT:
Error response from daemon: configured logging driver does not support reading

FROM
WORKDIR /TestFolder
COPY ./Binaries .
ENTRYPOINT ["ColorConsole.exe",  "--help" ]

CLI OUTPUT:
1f823e0d8d7cdaeef6df34e28805e3dfca6291303ffbffe8b66f0328e02cdc1c encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: The requested virtual machine or container operation is not valid in the current state. (0xc0370105)

FROM 
WORKDIR /Binaries
COPY ./Binaries .
ENTRYPOINT ["ColorConsole.exe"]
CMD [ “--help” ]

CLI OUTPUT:
c341eec329c10260942c861979402f21af4866a6f2b110e936a0dd643cb8fab8 encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: The requested virtual machine or container operation is not valid in the current state. (0xc0370105)
LOG OUTPUT:
e]0;C:\Binaries\ColorConsole.exea

FROM mcr.microsoft.com/windows:10.0.19042.1110-amd64 
COPY ./Binaries ./TestFolder/
WORKDIR /TestFolder
RUN  ["c:\\TestFolder\\ColorConsole.exe"]

LOG OUTPUT:
Error response from daemon: configured logging driver does not support reading
CLI OUTPUT:
container d8b27dfdc579bda887a8a7e8fb45e8aa6ed40da5da9c26d627bcc167aef932ee encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: The requested virtual machine or container operation is not valid in the current state. (0xc0370105)

mod update: wrapped Dockerfile content into </> code blocks.

RUN is for running commands while building the image. What you are looking for is CMD
CMD ["ColorConsole.exe", "--help" ]

I get the same error when trying this way

container 94ccf7985ce6b9d8564ce0fab98cb331934735b191b2916676f3fbf678eff078 encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: The requested virtual machine or container operation is not valid in the current state. (0xc0370105)

and this in the log

e]0;C:\TestFolder\TestApplication.exea

FROM mcr.microsoft.com/windows:10.0.19042.1110-amd64 

COPY ./Binaries/ /TestFolder

WORKDIR /TestFolder

CMD ["C:/TestFolder/TestApplication.exe", "--help" ]

This is my current attempt

FROM mcr.microsoft.com/windows:10.0.19042.1110-amd64

WORKDIR c:\\test

COPY Binaries c:\\test\\Binaries

ENTRYPOINT [ "c:\\test\\Binaries\\ColormapperConsole.exe"]

CMD ["--help"]

Just a random idea: has your Docker been set up to use Windows containers (rather than Linux containers)? I guess so, assuming you saw Docker pull the image, but maybe docker info will tell when in doubt. Also, running Microsoft’s quick start will probably tell you if the setup is okay.

Yeah, it’s setup for Windows Containers. I’m able to run other containers but not this one.