Building Docker Image For MySql 8.0.11 From Microsoft/Windowsservercore Base Image

· Read in about 1 min · (140 words) ·

I wanted to setup a testing docker image for .NET and MySql 8.0.11. Unfortunatelly it didn’t work out of the box but I found it pretty easily that the missing dependency on the image is Microsoft Visual C++ 2015 Redistributable Update 3.

Below is Dockerfile I used to build the image.

Into the same directory put download 8.0.11 Mysql server version named as

Please note that the image below is created with root user without a password specified

FROM microsoft/windowsservercore

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

COPY c:\\

RUN Expand-Archive c:/ -DestinationPath C:/ ; \
    Remove-Item c:/

RUN $env:PATH = 'C:\\mysql-8.0.11-winx64\\bin\\;' + $env:PATH; \
    [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine);

RUN Invoke-WebRequest '' -OutFile vcredist_x64.exe ; \
    Start-Process vcredist_x64.exe -ArgumentList '/install', '/passive', '/norestart' -NoNewWindow -Wait ; \
    Remove-Item vcredist_x64.exe

RUN C:\\mysql-8.0.11-winx64\\bin\\mysqld --initialize-insecure
RUN C:\\mysql-8.0.11-winx64\\bin\\mysqld --install

ENTRYPOINT ["cmd.exe"]