-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile-phase1
41 lines (40 loc) · 2.39 KB
/
Dockerfile-phase1
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
ARG IMAGE=containers.intersystems.com/intersystems/iris-community:2022.2.0.368.0
ARG IMAGEARM=containers.intersystems.com/intersystems/iris-community-arm64:2022.2.0.368.0
ARG DEV=0
FROM $IMAGE
RUN \
wget -q https://pm.community.intersystems.com/packages/zpm/latest/installer -O /tmp/zpm.xml && \
mkdir /usr/irissys/mgr/zpm && \
iris start $ISC_PACKAGE_INSTANCENAME quietly && \
/bin/echo -e \
"set pNS(\"Globals\")=\"%DEFAULTDB\"\n" \
"set sc=##class(Config.Namespaces).Create(\"%ALL\",.pNS)\n" \
"if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \
"set pDB(\"Directory\")=\"/usr/irissys/mgr/zpm/\"\n" \
"set sc=##class(SYS.Database).CreateDatabase(pDB(\"Directory\"), 30)\n" \
"do ##class(SYS.Database).MountDatabase(pDB(\"Directory\"))" \
"if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \
"set sc=##class(Config.Databases).Create(\"ZPM\",.pDB)\n" \
"if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \
"set pMap(\"Database\")=\"ZPM\"\n" \
"set sc=##Class(Config.MapPackages).Create(\"%ALL\",\"%ZPM\",.pMap)\n" \
"if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \
"set sc=##Class(Config.MapGlobals).Create(\"%ALL\",\"%ZPM.*\",.pMap)\n" \
"if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \
"set sc=##Class(Config.MapGlobals).Create(\"%SYS\",\"ZPM.*\",.pMap)\n" \
"if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \
"set sc=##Class(Config.MapRoutines).Create(\"%ALL\",\"%ZPM.*\",.pMap)\n" \
"if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \
"set sc=##Class(Config.MapRoutines).Create(\"%ALL\",\"%ZLANGF00\",.pMap)\n" \
"if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \
"set sc=##Class(Config.MapRoutines).Create(\"%ALL\",\"%ZLANGC00\",.pMap)\n" \
"if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \
"set sc = ##class(%SYSTEM.OBJ).Load(\"/tmp/zpm.xml\", \"c\")\n" \
"if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \
"do ##class(SYS.Database).Defragment(pDB(\"Directory\"))" \
"do ##class(SYS.Database).CompactDatabase(pDB(\"Directory\"),100)" \
"do ##class(SYS.Database).ReturnUnusedSpace(pDB(\"Directory\"))" \
"do ##class(SYS.Database).DismountDatabase(pDB(\"Directory\"))" \
"halt" \
| iris session $ISC_PACKAGE_INSTANCENAME -U %SYS && \
iris stop $ISC_PACKAGE_INSTANCENAME quietly