You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1.3 KiB

  1. # The MSI installs a service which is hard to override, so let's use a zip file.
  2. FROM microsoft/windowsservercore
  3. MAINTAINER alexellis2@gmail.com
  4. SHELL ["powershell"]
  5. RUN $ErrorActionPreference = 'Stop'; \
  6. wget https://github.com/MSOpenTech/redis/releases/download/win-3.2.100/Redis-x64-3.2.100.zip -OutFile Redis-x64-3.2.100.zip ; \
  7. Expand-Archive Redis-x64-3.2.100.zip -dest 'C:\\Program Files\\Redis\\' ; \
  8. Remove-Item Redis-x64-3.2.100.zip -Force
  9. RUN setx PATH '%PATH%;C:\\Program Files\\Redis\\'
  10. WORKDIR 'C:\\Program Files\\Redis\\'
  11. RUN Get-Content redis.windows.conf | Where { $_ -notmatch 'bind 127.0.0.1' } | Set-Content redis.openport.conf ; \
  12. Get-Content redis.openport.conf | Where { $_ -notmatch 'protected-mode yes' } | Set-Content redis.unprotected.conf ; \
  13. Add-Content redis.unprotected.conf 'protected-mode no' ; \
  14. Add-Content redis.unprotected.conf 'bind 0.0.0.0' ; \
  15. Get-Content redis.unprotected.conf
  16. EXPOSE 6379
  17. RUN set-itemproperty -path 'HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters' -Name ServerPriorityTimeLimit -Value 0 -Type DWord
  18. # Define our command to be run when launching the container
  19. CMD .\\redis-server.exe .\\redis.unprotected.conf --port 6379 ; \
  20. Write-Host Redis Started... ; \
  21. while ($true) { Start-Sleep -Seconds 3600 }