StefanScherer / dockerfiles-windows

Various Dockerfiles for Windows Containers
MIT License
1.1k stars 396 forks source link

Apache build does not build #442

Closed IwanSE closed 3 years ago

IwanSE commented 4 years ago

Hello @StefanScherer , apache httpd docker image building failed with copy dll.

Build log ``` PS E:\test> docker build -t test:httpd . Sending build context to Docker daemon 28.44MB Step 1/9 : FROM mcr.microsoft.com/windows/servercore:ltsc2016 as download ---> db71df64cd7f Step 2/9 : SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] ---> Using cache ---> 66f189467cc8 Step 3/9 : ENV APACHE_VERSION 2.4.29 ---> Using cache ---> 4458d5a971e2 Step 4/9 : RUN Invoke-WebRequest 'https://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x64.exe' -OutFile 'vc_redist.x64.exe'; Start-Process '.\vc_redist.x64.exe' '/install /passive /norestart' -Wait; Remove-Item vc_redist.x 64.exe; ---> Using cache ---> 09126cb02de5 Step 5/9 : FROM mcr.microsoft.com/windows/servercore:ltsc2016 ---> db71df64cd7f Step 6/9 : COPY --from=download C:\windows\system32\msvcp140.dll C:\windows\system32 COPY failed: CreateFile \\?\Volume{26997f88-241e-11ea-a24d-958c981464e7}\windows\system32\msvcp140.dll: The system cannot find the file specified. PS E:\test> ```
Docker and Windows version ``` PS E:\test> docker version Client: Docker Engine - Community Version: 18.09.2 API version: 1.39 Go version: go1.10.8 Git commit: 6247962 Built: Sun Feb 10 04:12:31 2019 OS/Arch: windows/amd64 Experimental: false Server: Docker Engine - Community Engine: Version: 18.09.2 API version: 1.39 (minimum version 1.24) Go version: go1.10.6 Git commit: 6247962 Built: Sun Feb 10 04:28:48 2019 OS/Arch: windows/amd64 Experimental: true Windows Server 2016 OS Build 14393.3630 ```

I can not upgrade Windows and Docker to the latest version. I can use only this version...

Any help in solving the problem.

The question is, how can I redirect log output to the container for httpd?

Output logs in container ``` New-Item -ItemType HardLink -Path "C:/Apache24/logs/output.log" -Target "C:/Apache24/logs/access.log" powershell cat C:/Apache24/logs/output.log -Tail 1 -Wait after some time... cat : The process cannot access the file because another process has locked a portion of the file At line:1 char:1 + cat C:/Apache24/logs/output.log -Tail 1 -Wait + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ReadError: (C:\Apache24\logs\output.log:String) [Get-Content], IOException + FullyQualifiedErrorId : GetContentReaderIOError,Microsoft.PowerShell.Com mands.GetContentCommand ```

I tried to do so, but the file is locked for reading and the container crashes.

StefanScherer commented 4 years ago

Hey @iwanhsky Oh, well it worked at the time of writing this Dockerfile. You could try and remove the second stage lines 16...20 https://github.com/StefanScherer/dockerfiles-windows/blob/main/apache/Dockerfile#L16-L20 The resulting image is a bit bigger, but maybe the build works for you.

eeevans commented 4 years ago

I suspect the file is locked by either antivirus software or indexing service. You may be able to use lockhunter to figure out the locking process but make sure the folder location is in the exceptions list for both of these types of software.

IwanSE commented 3 years ago

Hello, @StefanScherer I took the files from the build image. @eeevans I don't think the build goes to Docker. I suspect vc_redist update.

Thanks for the answers, I close the issue.