forked from kevinobee/docker-solr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (23 loc) · 1.18 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Builds Solr image for a Windows container environment
# escape=\
FROM microsoft/windowsservercore
SHELL ["powershell", "-NoProfile", "-Command", "$ErrorActionPreference = 'Stop';"]
# Download and install Java - Solr dependency
RUN Invoke-WebRequest -Method Get -Uri http://javadl.oracle.com/webapps/download/AutoDL?BundleId=210185 -OutFile /jreinstaller.exe ; \
Start-Process -FilePath C:\jreinstaller.exe -PassThru -wait -ArgumentList "/s,INSTALLDIR=c:\Java\jre" ; \
del C:\jreinstaller.exe
ENV JAVA_HOME c:\\Java\\jre
# Write variables to the master environment in the registry
RUN setx PATH '%PATH%;c:\\Java\\jre'
# Download and extract Solr project files
RUN Invoke-WebRequest -Method Get -Uri "http://archive.apache.org/dist/lucene/solr/8.5.2/solr-8.5.2.zip" -OutFile /solr.zip ; \
Expand-Archive -Path /solr.zip -DestinationPath /solr ; \
Remove-Item /solr.zip -Force
WORKDIR "/solr/solr-6.6.1"
EXPOSE 8983
HEALTHCHECK CMD powershell -command \
try { \
$response = iwr "http://localhost:8983" -UseBasicParsing; \
if ($response.StatusCode -eq 200) { return 0} else {return 1}; \
} catch { return 1 }
ENTRYPOINT bin/solr start -port 8983 -f -noprompt