From 8b205b688f367c18ad7b019e0d6f1c2ee104e362 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rok=20Ro=C5=A1kar?= Date: Fri, 22 Jul 2022 12:08:06 +0200 Subject: [PATCH] chore: update build steps for buildx --- .../workflows/build_and_push_to_docker.yml | 30 ++++++++++++++----- docker/r/Dockerfile | 2 +- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build_and_push_to_docker.yml b/.github/workflows/build_and_push_to_docker.yml index eebad46b..6814d54e 100644 --- a/.github/workflows/build_and_push_to_docker.yml +++ b/.github/workflows/build_and_push_to_docker.yml @@ -48,11 +48,9 @@ jobs: export LABEL_PREFIX=${{ matrix.BASE_IMAGE_TAG }} fi - docker buildx build \ - --platform ${{env.DOCKER_PLATFORMS}} \ + docker build \ --tag $DOCKER_NAME-py:$LABEL_PREFIX-$LABEL \ --build-arg BASE_IMAGE="jupyter/base-notebook:${{ matrix.BASE_IMAGE_TAG }}" \ - --push \ docker/py echo "::set-output name=IMAGE_NAME::$DOCKER_NAME-py:$LABEL_PREFIX-$LABEL" - name: Image Acceptance Tests @@ -65,10 +63,22 @@ jobs: command: npx mocha test.js - name: Push to docker run: | - docker push ${{ steps.build-image.outputs.IMAGE_NAME }} + docker buildx build \ + --platform ${{env.DOCKER_PLATFORMS}} \ + --tag ${{ steps.build-image.outputs.IMAGE_NAME }} \ + --build-arg BASE_IMAGE="jupyter/base-notebook:${{ matrix.BASE_IMAGE_TAG }}" \ + --push \ + docker/py # on master push latest image - the lab-* image is tagged latest if [ "$REF" == "refs/heads/master" ] && [ "${{ matrix.BASE_IMAGE_TAG }}" == lab-* ]; then + docker buildx build \ + --platform ${{env.DOCKER_PLATFORMS}} \ + --tag $DOCKER_NAME-py:latest \ + --build-arg BASE_IMAGE="jupyter/base-notebook:${{ matrix.BASE_IMAGE_TAG }}" \ + --push \ + docker/py + docker tag ${{ steps.build-image.outputs.IMAGE_NAME }} $DOCKER_NAME-py:latest docker push $DOCKER_NAME-py:latest fi @@ -281,7 +291,7 @@ jobs: export LABEL=$(echo ${{ github.sha }} | cut -c 1-7) fi - docker build docker/$EXTENSION \ + docker buildx build docker/$EXTENSION \ --build-arg BASE_IMAGE="$DOCKER_NAME-vnc:$LABEL" \ --tag $DOCKER_NAME-$EXTENSION:$LABEL \ --push @@ -353,9 +363,10 @@ jobs: fi export DOCKER_TAG="${{ matrix.JULIAVERSIONS }}-$LABEL" - docker buildx build --platform ${{env.DOCKER_PLATFORMS}} docker/julia \ + docker build \ --build-arg BASE_IMAGE="$DOCKER_NAME-py:3.9-$LABEL" \ - --tag $DOCKER_NAME-julia:$DOCKER_TAG + --tag $DOCKER_NAME-julia:$DOCKER_TAG \ + docker/julia echo "::set-output name=IMAGE_NAME::$DOCKER_NAME-julia:$DOCKER_TAG" - name: Image Acceptance Tests uses: cypress-io/github-action@v2 @@ -367,7 +378,10 @@ jobs: command: npx mocha test.js - name: Push to docker run: | - docker push ${{ steps.build-image.outputs.IMAGE_NAME }} + docker buildx build --platform ${{env.DOCKER_PLATFORMS}} docker/julia \ + --build-arg BASE_IMAGE="$DOCKER_NAME-py:3.9-$LABEL" \ + --tag ${{ steps.build-image.outputs.IMAGE_NAME }} \ + --push build-r-ubuntu: needs: build-py diff --git a/docker/r/Dockerfile b/docker/r/Dockerfile index 7927b07c..1664f5d5 100644 --- a/docker/r/Dockerfile +++ b/docker/r/Dockerfile @@ -96,7 +96,7 @@ USER ${NB_USER} RUN echo ". ${CONDA_PATH}/etc/profile.d/conda.sh" >> ~/.bashrc && \ echo "conda activate base" >> ~/.bashrc -RUN pip install "jupyter-rsession-proxy==2.0.1" +RUN /opt/conda/bin/python -m pip install "jupyter-rsession-proxy==2.0.1" # install IRKernel RUN R --quiet -e "install.packages('IRkernel')" && \