Skip to content

Commit

Permalink
chore: update build steps for buildx
Browse files Browse the repository at this point in the history
  • Loading branch information
rokroskar committed Jul 22, 2022
1 parent 9afbb44 commit 8b205b6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
30 changes: 22 additions & 8 deletions .github/workflows/build_and_push_to_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docker/r/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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')" && \
Expand Down

0 comments on commit 8b205b6

Please sign in to comment.