-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
63 lines (56 loc) · 1.93 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
ARG NANOSERVER_VERSION=lts-nanoserver-1809
FROM mcr.microsoft.com/powershell:${NANOSERVER_VERSION} AS build
LABEL \
org.label-schema.name="NanoServer-MySQL" \
org.label-schema.description="This image is an MySQL from Azul Systems® Zulu on NanoServer image." \
org.label-schema.version="1.0.0" \
org.label-schema.schema-version="1.0" \
org.label-schema.vendor="Hitoshi Kuroyanagi" \
org.label-schema.url="https://www.azul.com/" \
org.label-schema.maintainer.name="euledge" \
org.label-schema.vcs-url="https://github.com/euledge/nanoserver-mysql"\
org.label-schema.docker.cmd="docker run --name $CONTAINER -t -d nanoserver-mysql:latest" \
org.label-schema.docker.params="OPENJDK_VERSION=version number"
ARG MYSQL_VERSION=8.0.25-winx64
SHELL ["pwsh", "-Command"]
RUN \
if(!(Test-Path -Path 'C:\Temp')) \
{ \
New-Item \
-Path 'C:\Temp' \
-ItemType Directory \
-Verbose | Out-Null ; \
} ;
RUN \
Invoke-WebRequest \
-Uri "https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-$ENV:MYSQL_VERSION.zip" \
-OutFile "C:\\Temp\\mysql-$ENV:MYSQL_VERSION.zip" \
-UseBasicParsing \
-Verbose ; \
\
Expand-Archive \
-Path "C:\\Temp\\mysql-$ENV:MYSQL_VERSION.zip" \
-DestinationPath 'C:\Program Files' \
-Verbose ;
USER ContainerAdministrator
RUN \
Set-ItemProperty \
-Path 'HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment' \
-Name 'MYSQL_HOME' \
-Value $('C:\Program Files\mysql-' + $ENV:MYSQL_VERSION) \
-Verbose ; \
\
Set-ItemProperty \
-Path 'HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment' \
-Name 'Path' \
-Value $($ENV:Path + ';C:\Program Files\mysql-' + $ENV:MYSQL_VERSION + '\bin') \
-Verbose ;
USER ContainerUser
# Test application
#RUN mysql --version
# Remove temporary items from the build image
RUN \
Remove-Item \
-Path 'C:\Temp' \
-Recurse \
-Verbose ;