/
Dockerfile
32 lines (26 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
FROM microsoft/nanoserver
# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
# PATH isn't actually set in the Docker image, so we have to set it from within the container
RUN $newPath = ('C:\Redis;{0}' -f $env:PATH); \
Write-Host ('Updating PATH: {0}' -f $newPath); \
# Nano Server does not have "[Environment]::SetEnvironmentVariable()"
setx /M PATH $newPath;
# doing this first to share cache across versions more aggressively
ENV REDIS_VERSION 3.0.504
ENV REDIS_DOWNLOAD_URL https://github.com/MSOpenTech/redis/releases/download/win-${REDIS_VERSION}/Redis-x64-${REDIS_VERSION}.zip
RUN Write-Host ('Downloading {0} ...' -f $env:REDIS_DOWNLOAD_URL); \
Invoke-WebRequest -Uri $env:REDIS_DOWNLOAD_URL -OutFile 'redis.zip'; \
\
Write-Host 'Expanding ...'; \
Expand-Archive redis.zip -DestinationPath C:\Redis; \
\
Write-Host 'Verifying install ("redis-server --version") ...'; \
redis-server --version; \
\
Write-Host 'Removing ...'; \
Remove-Item redis.zip -Force
VOLUME C:\\data
WORKDIR C:\\data
EXPOSE 6379
CMD ["redis-server.exe"]