I’m running windows containers docker.
I’m trying to create a aspnet build/publish machine and I want to install the Net FX tools that are required for that.
Simple Docker file for test:
COPY ./Distr/NDP461-DevPack-KB3105179-ENU.exe 'C:\'
RUN & ‘C:\NDP461-DevPack-KB3105179-ENU.exe’ /q /norestart
docker build --no-cache=true -t buildtestimage .
docker run -d -h buildtest --name buildtest buildtestimage
The file is correctly copied. There’s no output from RUN (no errors).
However the install doesn’t create needed files and folders (Microsoft SDK) - like it did nothing.
More over, running it manually (trough docker exec) doesn’t do anything either.
BUT! If I remove the COPY + RUN instructions from Dockerfile and basically do the same steps through docker cp and docker exec - everything is working. (Code below. buildtest - name of container)
docker stop buildtest
docker cp ‘C:\Projects\Test\Distr\NDP461-DevPack-KB3105179-ENU.exe’ buildtest:C:\
docker start buildtest
docker exec -ti buildtest ‘C:\NDP461-DevPack-KB3105179-ENU.exe’ /q /norestart
Why? I mean, there’s somekind of lock on that installation file after it’s copied through dockerfile COPY instruction. I’d like to know, why it doesn’t work and if there are any workarounds?
tl;dr: How to install distributive from host into image during docker build ? COPY + RUN didn’t work.