diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d396a3f..52b4800 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,10 +14,11 @@ env: irishealth-community iris-ml-community irishealth-ml-community - latest: 2023.2.0.227.0 + latest: 2023.3 version: | - 2022.1.2.574.0 - preview: 2023.3-preview + 2023.2 + 2023.1.1.380.0 + preview: latest-preview jobs: version: runs-on: ubuntu-latest @@ -82,19 +83,19 @@ jobs: retry_on: timeout command: | docker pull ${{ steps.vars.outputs.basearm }} + - name: docker login + id: login + continue-on-error: true + run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} - name: build x86 docker image id: build uses: nick-invision/retry@v2 with: timeout_minutes: 10 max_attempts: 3 - retry_on: timeout + retry_on: any command: | - docker build --build-arg IMAGE=${{ steps.vars.outputs.base }} --build-arg IMAGEARM=${{ steps.vars.outputs.basearm }} ${{ steps.vars.outputs.tags }} --platform linux/amd64 --target x86 . - - name: docker login - id: login - continue-on-error: true - run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} + docker build --progress plain --no-cache --file Dockerfile-amd64 --build-arg IMAGE=${{ steps.vars.outputs.base }} --build-arg IMAGEARM=${{ steps.vars.outputs.basearm }} ${{ steps.vars.outputs.tags }} --platform linux/amd64 . - name: push to docker hub id: push if: steps.login.outcome == 'success' @@ -108,9 +109,10 @@ jobs: with: timeout_minutes: 10 max_attempts: 3 - retry_on: timeout + retry_on: any command: | - docker buildx build --load --build-arg IMAGE=${{ steps.vars.outputs.base }} --build-arg IMAGEARM=${{ steps.vars.outputs.basearm }} ${{ steps.vars.outputs.tagsarm }} --platform linux/arm64 --target arm . + docker system prune -f + docker build --progress plain --no-cache --file Dockerfile-arm64 --build-arg IMAGE=${{ steps.vars.outputs.base }} --build-arg IMAGEARM=${{ steps.vars.outputs.basearm }} ${{ steps.vars.outputs.tagsarm }} --platform linux/arm64 . - name: push arm64 to docker hub id: pusharm if: steps.buildarm.outcome == 'success' @@ -119,10 +121,15 @@ jobs: echo $tags | xargs -n1 sh -c 'docker push $0' - name: update manifest if: steps.push.outcome == 'success' && steps.pusharm.outcome == 'success' - run: | - tags="${{ steps.vars.outputs.tagsarm }}";tags=${tags// -t / } - echo $tags | xargs -n1 bash -c 'docker manifest rm ${1//-arm64/} || true' - $1 - echo $tags | xargs -n1 bash -c 'docker manifest inspect ${1//-arm64/}' - $1 - echo $tags | xargs -n1 bash -c 'docker manifest create ${1//-arm64/} ${1//-arm64/} $1 --amend' - $1 - echo $tags | xargs -n1 bash -c 'docker manifest push ${1//-arm64/}' - $1 - echo $tags | xargs -n1 bash -c 'docker manifest inspect ${1//-arm64/}' - $1 + uses: nick-invision/retry@v2 + with: + timeout_minutes: 10 + max_attempts: 3 + retry_on: timeout + command: | + tags="${{ steps.vars.outputs.tagsarm }}";tags=${tags// -t / } + echo $tags | xargs -n1 bash -c 'docker manifest rm ${1//-arm64/} || true' - $1 + echo $tags | xargs -n1 bash -c 'docker manifest inspect ${1//-arm64/}' - $1 + echo $tags | xargs -n1 bash -c 'docker manifest create ${1//-arm64/} ${1//-arm64/} $1 --amend' - $1 + echo $tags | xargs -n1 bash -c 'docker manifest push ${1//-arm64/}' - $1 + echo $tags | xargs -n1 bash -c 'docker manifest inspect ${1//-arm64/}' - $1 diff --git a/Dockerfile-amd64 b/Dockerfile-amd64 new file mode 100644 index 0000000..b9fcd7d --- /dev/null +++ b/Dockerfile-amd64 @@ -0,0 +1,7 @@ +# syntax = edrevo/dockerfile-plus + +INCLUDE+ Dockerfile-phase1 + +FROM --platform=linux/amd64 $IMAGE as x86 + +INCLUDE+ Dockerfile-phase2 \ No newline at end of file diff --git a/Dockerfile-arm64 b/Dockerfile-arm64 new file mode 100644 index 0000000..495cb9c --- /dev/null +++ b/Dockerfile-arm64 @@ -0,0 +1,7 @@ +# syntax = edrevo/dockerfile-plus + +INCLUDE+ Dockerfile-phase1 + +FROM --platform=linux/arm64 $IMAGEARM as arm + +INCLUDE+ Dockerfile-phase2 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile-phase1 similarity index 55% rename from Dockerfile rename to Dockerfile-phase1 index aab80e6..f88038e 100644 --- a/Dockerfile +++ b/Dockerfile-phase1 @@ -39,65 +39,3 @@ RUN \ "halt" \ | iris session $ISC_PACKAGE_INSTANCENAME -U %SYS && \ iris stop $ISC_PACKAGE_INSTANCENAME quietly - -FROM --platform=linux/amd64 $IMAGE as x86 - -USER root - -WORKDIR /opt/irisapp -RUN chown ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/irisapp && \ - apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get -y install git && \ - apt-get clean -y && rm -rf /var/lib/apt/lists/* && \ - mkdir /docker-entrypoint-initdb.d/ - -COPY docker-entrypoint.sh / - -USER ${ISC_PACKAGE_MGRUSER} - -COPY --from=0 --chown=${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /usr/irissys/iris.cpf /usr/irissys/iris.cpf -COPY --from=0 --chown=${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /usr/irissys/mgr/zpm /usr/irissys/mgr/zpm - -ENV PATH="$PATH:/home/irisowner/.local/bin" - -COPY --chown=${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} iris_ipm.py /usr/irissys/lib/python/ - -RUN pip install irissqlcli && \ - cat /usr/irissys/lib/python/iris_ipm.py >> /usr/irissys/lib/python/iris.py - -COPY iriscli /home/irisowner/bin/ - -ENTRYPOINT [ "/tini", "--", "/docker-entrypoint.sh" ] - -CMD [ "iris" ] - -FROM --platform=linux/arm64 $IMAGEARM as arm - -USER root - -WORKDIR /opt/irisapp -RUN chown ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/irisapp && \ - apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get -y install git && \ - apt-get clean -y && rm -rf /var/lib/apt/lists/* && \ - mkdir /docker-entrypoint-initdb.d/ - -COPY docker-entrypoint.sh / - -USER ${ISC_PACKAGE_MGRUSER} - -COPY --from=0 --chown=${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /usr/irissys/iris.cpf /usr/irissys/iris.cpf -COPY --from=0 --chown=${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /usr/irissys/mgr/zpm /usr/irissys/mgr/zpm - -ENV PATH="$PATH:/home/irisowner/.local/bin" - -COPY --chown=${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} iris_ipm.py /usr/irissys/lib/python/ - -RUN pip install irissqlcli && \ - cat /usr/irissys/lib/python/iris_ipm.py >> /usr/irissys/lib/python/iris.py - -COPY iriscli /home/irisowner/bin/ - -ENTRYPOINT [ "/tini", "--", "/docker-entrypoint.sh" ] - -CMD [ "iris" ] diff --git a/Dockerfile-phase2 b/Dockerfile-phase2 new file mode 100644 index 0000000..1f24a6f --- /dev/null +++ b/Dockerfile-phase2 @@ -0,0 +1,28 @@ +USER root + +WORKDIR /opt/irisapp +RUN chown ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/irisapp && \ + apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get -y install git && \ + apt-get clean -y && rm -rf /var/lib/apt/lists/* && \ + mkdir /docker-entrypoint-initdb.d/ + +COPY docker-entrypoint.sh / + +USER ${ISC_PACKAGE_MGRUSER} + +COPY --from=0 --chown=${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /usr/irissys/iris.cpf /usr/irissys/iris.cpf +COPY --from=0 --chown=${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /usr/irissys/mgr/zpm /usr/irissys/mgr/zpm + +ENV PATH="$PATH:/home/irisowner/.local/bin" + +COPY --chown=${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} iris_ipm.py /usr/irissys/lib/python/ + +RUN pip install irissqlcli && \ + cat /usr/irissys/lib/python/iris_ipm.py >> /usr/irissys/lib/python/iris.py + +COPY iriscli /home/irisowner/bin/ + +ENTRYPOINT [ "/tini", "--", "/docker-entrypoint.sh" ] + +CMD [ "iris" ]