-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerfile
36 lines (26 loc) · 1.12 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
33
34
35
36
FROM mcr.microsoft.com/powershell:lts-nanoserver-1809
LABEL author="Julien Creach"
LABEL maintainer="[email protected]"
USER ContainerAdministrator
SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
# Env var redis
RUN $newPath = ('c:\redis;{0}' -f $env:PATH); Write-Host ('Updating PATH: {0}' -f $newPath); setx /M PATH $newPath;
# Download redisw
ARG REDIS_VERSION=5.0.14.1
ADD https://github.com/tporadowski/redis/releases/download/v${REDIS_VERSION}/Redis-x64-${REDIS_VERSION}.zip redis.zip
# Install redis
RUN Expand-Archive .\redis.zip -DestinationPath c:\redis;
RUN Write-Host 'Verifying install ("redis-server --version") ...';
RUN redis-server --version;
# Clean files
RUN Write-Host 'Removing ...';
RUN Remove-Item .\redis.zip -Force;
# Configuration
RUN (Get-Content c:\redis\redis.windows.conf) -Replace '^(bind)\s+.*$', '$1 0.0.0.0' -Replace '^(protected-mode)\s+.*$', '$1 no' | Set-Content C:\Redis\redis.docker.conf;
# Volumes
VOLUME "c:\data"
WORKDIR "c:\data"
# Ports
EXPOSE 6379/tcp
ENTRYPOINT [ "redis-server.exe" ]
CMD ["c:\\redis\\redis.docker.conf"]