From 77a58b9fc3f836aaa8d258b8bb4b0d663071bab2 Mon Sep 17 00:00:00 2001 From: SergeyMi37 Date: Thu, 26 Oct 2023 19:21:47 +0300 Subject: [PATCH] change docker in multi-stage mode to reduce size --- Dockerfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d735263..ec33e9f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ ARG IMAGE=intersystemsdc/irishealth-community ARG IMAGE=intersystemsdc/iris-community -FROM $IMAGE +FROM $IMAGE as builder USER root ## add git @@ -18,3 +18,11 @@ COPY iris.script iris.script RUN iris start IRIS \ && iris session IRIS < iris.script \ && iris stop IRIS quietly + +FROM $IMAGE as final + +ADD --chown=${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} https://github.com/grongierisc/iris-docker-multi-stage-script/releases/latest/download/copy-data.py /irisdev/app/copy-data.py + +RUN --mount=type=bind,source=/,target=/builder/root,from=builder \ + cp -f /builder/root/usr/irissys/iris.cpf /usr/irissys/iris.cpf && \ + python3 /irisdev/app/copy-data.py -c /usr/irissys/iris.cpf -d /builder/root/ \ No newline at end of file