Skip to content

Commit 50cab7d

Browse files
committed
make docker images tiny
1 parent d1348ae commit 50cab7d

4 files changed

Lines changed: 37 additions & 14 deletions

File tree

.vscode/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"files.associations": {
3-
3+
44
"Dockerfile*": "dockerfile",
55
"iris.script": "objectscript"
66
},
77
"objectscript.conn" :{
8-
"active": false,
8+
"active": true,
99
"ns": "IRISAPP",
1010
"username": "_SYSTEM",
1111
"password": "SYS",

Dockerfile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
ARG IMAGE=intersystemsdc/irishealth-community:2020.3.0.200.0-zpm
22
ARG IMAGE=intersystemsdc/iris-community:2020.4.0.547.0-zpm
33
ARG IMAGE=containers.intersystems.com/intersystems/iris:2021.1.0.215.0
4-
ARG IMAGE=intersystemsdc/iris-community
54
ARG IMAGE=intersystemsdc/iris-community:preview
6-
FROM $IMAGE
5+
ARG IMAGE=intersystemsdc/iris-community
6+
FROM $IMAGE as builder
77

88
WORKDIR /home/irisowner/irisdev
99

1010
## install git
11-
## USER root
11+
## USER root
1212
##RUN apt update && apt-get -y install git
1313
##USER ${ISC_PACKAGE_MGRUSER}
1414

@@ -30,3 +30,12 @@ RUN --mount=type=bind,src=.,dst=. \
3030
iris session IRIS < iris.script && \
3131
([ $TESTS -eq 0 ] || iris session iris -U $NAMESPACE "##class(%ZPM.PackageManager).Shell(\"test $MODULE -v -only\",1,1)") && \
3232
iris stop IRIS quietly
33+
34+
35+
FROM $IMAGE as final
36+
ADD --chown=${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} https://github.com/grongierisc/iris-docker-multi-stage-script/releases/latest/download/copy-data.py /home/irisowner/irisdev/copy-data.py
37+
#ADD https://github.com/grongierisc/iris-docker-multi-stage-script/releases/latest/download/copy-data.py /home/irisowner/irisdev/copy-data.py
38+
39+
RUN --mount=type=bind,source=/,target=/builder/root,from=builder \
40+
cp -f /builder/root/usr/irissys/iris.cpf /usr/irissys/iris.cpf && \
41+
python3 /home/irisowner/irisdev/copy-data.py -c /usr/irissys/iris.cpf -d /builder/root/

README.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44

55
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat&logo=AdGuard)](LICENSE)
66
# intersystems-iris-dev-template
7-
This is a basic template for a development environment to work with ObjectScript in InterSystems IRIS. It helps you edit, compile, commit/push, debug and test your ObjectScript code. It also aids in packaging your application as a module installable with IPM.
7+
This is a basic template for a development environment to work with ObjectScript in InterSystems IRIS. It helps you edit, compile, commit/push, debug and test your ObjectScript code. It also aids in packaging your application as a module installable with IPM.
88
The template is embedded python compatible.
99

1010
## Description
1111
This repository provides a ready-to-go development environment for coding productively with InterSystems ObjectScript. This template:
1212
* Runs InterSystems IRIS Community Edition in a docker container
1313
* Creates a new namespace and database IRISAPP
14-
* Loads the ObjectScript code into IRISAPP database using Package Manager
14+
* Loads the ObjectScript code into IRISAPP database using Package Manager
1515
* Promotes development with the 'Package First' paradigm. [Watch the video](https://www.youtube.com/watch?v=havPyPbUj1I)
1616
* Provides a unit testing environment: sample unit tests, tests module enablement
1717
* Ready for embedded python development: ENV varialbes are set up, CallIn service is On, all modules in requirements.txt will be installed during docker build.
@@ -23,16 +23,16 @@ Once you clone the new repo to your laptop and open VSCode (with the [InterSyste
2323
## Prerequisites
2424
Make sure you have [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and [Docker desktop](https://www.docker.com/products/docker-desktop) installed.
2525

26-
## Installation
26+
## Installation
2727

2828
Clone/git pull the repo into any local directory
2929

3030
```
3131
$ git clone https://github.com/intersystems-community/intersystems-iris-dev-template.git
3232
```
3333

34-
Open the terminal in this directory and call the command to build and run InterSystems IRIS in container:
35-
*Note: Users running containers on a Linux CLI, should use "docker compose" instead of "docker-compose"*
34+
Open the terminal in this directory and call the command to build and run InterSystems IRIS in container:
35+
*Note: Users running containers on a Linux CLI, should use "docker compose" instead of "docker-compose"*
3636
*See [Install the Compose plugin](https://docs.docker.com/compose/install/linux/)*
3737

3838

@@ -164,8 +164,8 @@ In case of test errors, you can find more details back in the UnitTest portal, w
164164

165165
### .github folder
166166

167-
Contains two GitHub actions workflows:
168-
1. `github-registry.yml`
167+
Contains two GitHub actions workflows:
168+
1. `github-registry.yml`
169169
Once changes pushed to the repo, the action builds the docker image on Github side and pushes the image to Github registry that can be very convenient to further cloud deployement, e.g. kubernetes.
170170
2. `objectscript-qaulity.yml`
171171
with every push to master or main branch the workflow launches the repo test on objectscript issues with Objectscript Quality tool, [see the examples](https://community.objectscriptquality.com/projects?sort=-analysis_date). This works if the repo is open-source only.
@@ -216,3 +216,16 @@ It describes what is loaded with the method, how it is being tested and what app
216216

217217
[Read about all the files in this artilce](https://community.intersystems.com/post/dockerfile-and-friends-or-how-run-and-collaborate-objectscript-projects-intersystems-iris)
218218

219+
220+
221+
## Troubleshooting
222+
223+
If you have issues with docker image building here are some recipes that could help.
224+
225+
1. You are out of free space in docker. You can expand the amount of space or clean up maually via docker desktop. Or you can call the following line to clean up:
226+
```
227+
docker system prune -f
228+
```
229+
230+
2. We use multi-stage image building which in some cases doesn't work. Switch the target to builder from final in the docker compose and try again.
231+

docker-compose.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
version: '3.6'
22
services:
33
iris:
4-
build:
4+
build:
55
context: .
66
dockerfile: Dockerfile
7+
target: final
78
restart: always
89
command: --check-caps false --ISCAgent false
9-
ports:
10+
ports:
1011
- 1972
1112
- 52773
1213
- 53773

0 commit comments

Comments
 (0)