Skip to content

Commit e58ffae

Browse files
committed
dockerfile cleanup, dev.md, passwordless
1 parent 1afa455 commit e58ffae

File tree

5 files changed

+133
-24
lines changed

5 files changed

+133
-24
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
.DS_Store
2-
2+
iris-main.log

Dockerfile

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
ARG IMAGE=intersystemsdc/iris-community:2020.3.0.221.0-zpm
2-
ARG IMAGE=intersystemsdc/iris-community:2020.4.0.524.0-zpm
32
ARG IMAGE=intersystemsdc/iris-community
43
FROM $IMAGE
54

6-
USER root
7-
8-
WORKDIR /opt/irisapp
9-
RUN chown ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/irisapp
10-
USER ${ISC_PACKAGE_MGRUSER}
5+
WORKDIR /home/irisowner/dev
116

12-
COPY src src
13-
COPY module.xml module.xml
14-
COPY iris.script /tmp/iris.script
15-
16-
RUN iris start IRIS \
17-
&& iris session IRIS < /tmp/iris.script \
18-
&& iris stop IRIS quietly
7+
RUN --mount=type=bind,src=.,dst=. \
8+
iris start IRIS && \
9+
iris session IRIS < iris.script && \
10+
iris stop IRIS quietly

dev.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# useful commands
2+
## clean up docker
3+
use it when docker says "There is no space left on device". It will remove built but not used images and other temporary files.
4+
```
5+
docker system prune -f
6+
```
7+
8+
```
9+
docker rm -f $(docker ps -qa)
10+
```
11+
12+
## build container with no cache
13+
```
14+
docker-compose build --no-cache --progress=plain
15+
```
16+
## start iris container
17+
```
18+
docker-compose up -d
19+
```
20+
21+
## open iris terminal in docker
22+
```
23+
docker exec iris iris session iris -U IRISAPP
24+
```
25+
26+
27+
## import objectscirpt code
28+
29+
do $System.OBJ.LoadDir("/home/irisowner/dev/src","ck",,1)
30+
## map iris key from Mac home directory to IRIS in container
31+
- ~/iris.key:/usr/irissys/mgr/iris.key
32+
33+
## install git in the docker image
34+
## add git in dockerfile
35+
USER root
36+
RUN apt update && apt-get -y install git
37+
38+
USER ${ISC_PACKAGE_MGRUSER}
39+
40+
41+
## install docker-compose
42+
```
43+
sudo curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
44+
45+
sudo chmod +x /usr/local/bin/docker-compose
46+
47+
```
48+
49+
## load and test module
50+
```
51+
52+
zpm "load /home/irisowner/dev"
53+
54+
zpm "test dc-sample"
55+
```
56+
57+
## select zpm test registry
58+
```
59+
repo -n registry -r -url https://test.pm.community.intersystems.com/registry/ -user test -pass PassWord42
60+
```
61+
62+
## get back to public zpm registry
63+
```
64+
repo -r -n registry -url https://pm.community.intersystems.com/ -user "" -pass ""
65+
```
66+
67+
## export a global in runtime into the repo
68+
```
69+
d $System.OBJ.Export("GlobalD.GBL","/irisrun/repo/src/gbl/GlobalD.xml")
70+
```
71+
72+
## create a web app in dockerfile
73+
```
74+
zn "%SYS" \
75+
write "Create web application ...",! \
76+
set webName = "/csp/irisweb" \
77+
set webProperties("NameSpace") = "IRISAPP" \
78+
set webProperties("Enabled") = 1 \
79+
set webProperties("CSPZENEnabled") = 1 \
80+
set webProperties("AutheEnabled") = 32 \
81+
set webProperties("iKnowEnabled") = 1 \
82+
set webProperties("DeepSeeEnabled") = 1 \
83+
set sc = ##class(Security.Applications).Create(webName, .webProperties) \
84+
write "Web application "_webName_" has been created!",!
85+
```
86+
87+
88+
89+
```
90+
do $SYSTEM.OBJ.ImportDir("/opt/irisbuild/src",, "ck")
91+
```
92+
93+
94+
### run tests described in the module
95+
96+
IRISAPP>zpm
97+
IRISAPP:zpm>load /irisrun/repo
98+
IRISAPP:zpm>test package-name
99+
100+
### install ZPM with one line
101+
// Install ZPM
102+
set $namespace="%SYS", name="DefaultSSL" do:'##class(Security.SSLConfigs).Exists(name) ##class(Security.SSLConfigs).Create(name) set url="https://pm.community.intersystems.com/packages/zpm/latest/installer" Do ##class(%Net.URLParser).Parse(url,.comp) set ht = ##class(%Net.HttpRequest).%New(), ht.Server = comp("host"), ht.Port = 443, ht.Https=1, ht.SSLConfiguration=name, st=ht.Get(comp("path")) quit:'st $System.Status.GetErrorText(st) set xml=##class(%File).TempFilename("xml"), tFile = ##class(%Stream.FileBinary).%New(), tFile.Filename = xml do tFile.CopyFromAndSave(ht.HttpResponse.Data) do ht.%Close(), $system.OBJ.Load(xml,"ck") do ##class(%File).Delete(xml)
103+
104+
105+
106+
107+
docker run --rm --name iris-sql -d -p 9091:1972 -p 9092:52773  -e IRIS_PASSWORD=demo -e IRIS_USERNAME=demo intersystemsdc/iris-community
108+
109+
110+
docker run --rm --name iris-ce -d -p 9091:1972 -p 9092:52773 -e IRIS_PASSWORD=demo -e IRIS_USERNAME=demo intersystemsdc/iris-community -a "echo 'zpm \"install webterminal\"' | iriscli"
111+
112+
113+
114+
docker run --rm --name iris-sql -d -p 9092:52773 containers.intersystems.com/intersystems/iris-community:2023.1.0.229.0
115+
116+
117+
docker run --rm --name iris-ce -d -p 9092:52773 containers.intersystems.com/intersystems/iris-community:2023.1.0.229.0

docker-compose.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
version: '3.6'
22
services:
33
iris:
4-
build:
4+
build:
55
context: .
66
dockerfile: Dockerfile
77
restart: always
8-
command: --check-caps false
9-
ports:
8+
ports:
109
- 51773:1972
1110
- 52773:52773
1211
- 53773
1312
volumes:
14-
- ./:/irisdev/app
13+
- ./:/home/irisowner/dev

iris.script

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
;do $System.OBJ.LoadDir("/opt/irisapp/src","ck",,1)
1+
;do $System.OBJ.LoadDir("/opt/irisapp/src","ck",,1)
22

3-
zn "%SYS"
4-
Do ##class(Security.Users).UnExpireUserPasswords("*")
3+
zn "%SYS"
4+
Do ##class(Security.Users).UnExpireUserPasswords("*")
5+
zpm "install passwordless"
56

6-
zn "USER"
7-
zpm "load /opt/irisapp/ -v":1:1
8-
halt
7+
zn "USER"
8+
zpm "load /home/irisowner/dev/ -v":1
9+
halt

0 commit comments

Comments
 (0)