Skip to content

Commit 21ea6d3

Browse files
committed
Updates repository to use a single Dockerfile to build all combinations.
1 parent df29146 commit 21ea6d3

28 files changed

+507
-1864
lines changed

.github/workflows/build-and-publish-docker-image.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ on:
3131
description: 'If true, then an additional tag without OS information is generated.'
3232
required: true
3333
type: boolean
34+
build_args:
35+
description: 'String Array of comma separated build-args. Ex ["val1=1", "val2=2", "val3=3"] '
36+
required: false
37+
type: string
3438

3539
jobs:
3640
build-push-image:
@@ -49,6 +53,12 @@ jobs:
4953
&& echo "TAG_RELEASE_AND_OS_CAMEL_CASE=${LOWER_CASE_MATLAB_RELEASE}-${{ inputs.os_info_tag }}" >> "$GITHUB_OUTPUT" \
5054
&& echo "TAG_RELEASE_AND_OS_PASCAL_CASE=${LOWER_CASE_MATLAB_RELEASE^}-${{ inputs.os_info_tag }}" >> "$GITHUB_OUTPUT"
5155
56+
- name: Create list of build args from array of strings
57+
id: build-args-as-list
58+
uses: lucaspinheirogit/[email protected]
59+
with:
60+
stringArray: ${{ inputs.build_args }}
61+
5262
# See here for example: https://docs.docker.com/build/ci/github-actions/push-multi-registries/
5363
# -
5464
# name: Login to Docker Hub
@@ -72,19 +82,21 @@ jobs:
7282
if: ${{ inputs.is_default_os == false }}
7383
uses: docker/build-push-action@v4
7484
with:
85+
build-args: ${{ steps.build-args-as-list.outputs.stringList }}
7586
context: ${{ inputs.docker_build_context }}
7687
platforms: linux/amd64
7788
push: true
7889
tags: |
7990
${{ inputs.base_image_name }}:${{ steps.setup_image_tags.outputs.TAG_RELEASE_AND_OS_CAMEL_CASE }}
8091
${{ inputs.base_image_name }}:${{ steps.setup_image_tags.outputs.TAG_RELEASE_AND_OS_PASCAL_CASE }}
81-
build-args: MATLAB_RELEASE=${{ inputs.matlab_release_tag }}
8292
93+
8394
# Example tags: r2023a-ubuntu20.04, R2023a-ubuntu20.04, r2023a, R2023a
8495
- name: Build & Push Image for latest OS
8596
if: ${{ inputs.is_default_os == true }}
8697
uses: docker/build-push-action@v4
8798
with:
99+
build-args: ${{ steps.build-args-as-list.outputs.stringList }}
88100
context: ${{ inputs.docker_build_context }}
89101
platforms: linux/amd64
90102
push: true
@@ -93,6 +105,5 @@ jobs:
93105
${{ inputs.base_image_name }}:${{ steps.setup_image_tags.outputs.TAG_RELEASE_ONLY_PASCAL_CASE }}
94106
${{ inputs.base_image_name }}:${{ steps.setup_image_tags.outputs.TAG_RELEASE_AND_OS_CAMEL_CASE }}
95107
${{ inputs.base_image_name }}:${{ steps.setup_image_tags.outputs.TAG_RELEASE_AND_OS_PASCAL_CASE }}
96-
build-args: MATLAB_RELEASE=${{ inputs.matlab_release_tag }}
97108
98109
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Copyright 2023-2024 The MathWorks, Inc.
2-
# Build & Publish matlab/Dockerfile
3-
name: matlab/Dockerfile
1+
# Copyright 2024 The MathWorks, Inc.
2+
# Build & Publish jupyter-matlab-notebook
3+
name: jupyter-matlab-notebook
44

55
# Define when builds will occur:
66
on:
@@ -9,7 +9,8 @@ on:
99
branches:
1010
- 'main'
1111
paths:
12-
- 'matlab/Dockerfile'
12+
- 'Dockerfile'
13+
- '.github/workflows/**'
1314

1415
# Run at 00:00 on every Monday (1st Day of the Week) (See: crontab.guru)
1516
schedule:
@@ -22,12 +23,13 @@ jobs:
2223
strategy:
2324
fail-fast: false
2425
matrix:
25-
matlab_release_tag: [r2024b, r2024a, r2023b, r2023a, r2022b]
26+
matlab_release_tag: [R2024b, R2024a, R2023b, R2023a, R2022b]
2627
uses: ./.github/workflows/build-and-publish-docker-image.yml
2728
secrets: inherit
2829
with:
29-
docker_build_context: './matlab'
30+
docker_build_context: '.'
3031
base_image_name: ghcr.io/${{ github.repository }}/jupyter-matlab-notebook
3132
os_info_tag: 'ubuntu22.04'
3233
matlab_release_tag: ${{ matrix.matlab_release_tag }}
3334
is_default_os: true
35+
build_args: '["MATLAB_RELEASE=${{ matrix.matlab_release_tag }}", "INSTALL_VNC=1", "INSTALL_MATLABENGINE=1", "MOUNT_MATLAB=1"]'
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Copyright 2023-2024 The MathWorks, Inc.
2-
# Build & Publish matlab/Dockerfile.mounted
3-
name: matlab/Dockerfile.mounted
1+
# Copyright 2024 The MathWorks, Inc.
2+
# Build & Publish jupyter-mounted-matlab-notebook
3+
name: jupyter-mounted-matlab-notebook
44

55
# Define when builds will occur:
66
on:
@@ -9,7 +9,8 @@ on:
99
branches:
1010
- 'main'
1111
paths:
12-
- 'matlab/Dockerfile.mounted'
12+
- 'Dockerfile'
13+
- '.github/workflows/**'
1314

1415
# Run at 00:00 on every Monday (1st Day of the Week) (See: crontab.guru)
1516
schedule:
@@ -22,12 +23,13 @@ jobs:
2223
strategy:
2324
fail-fast: false
2425
matrix:
25-
matlab_release_tag: [r2024b, r2024a, r2023b, r2023a, r2022b]
26+
matlab_release_tag: [R2024b, R2024a, R2023b, R2023a, R2022b]
2627
uses: ./.github/workflows/build-and-publish-docker-image.yml
2728
secrets: inherit
2829
with:
29-
docker_build_context: './matlab'
30+
docker_build_context: '.'
3031
base_image_name: ghcr.io/${{ github.repository }}/jupyter-mounted-matlab-notebook
3132
os_info_tag: 'ubuntu22.04'
3233
matlab_release_tag: ${{ matrix.matlab_release_tag }}
3334
is_default_os: true
35+
build_args: '["MATLAB_RELEASE=${{ matrix.matlab_release_tag }}", "INSTALL_VNC=1", "INSTALL_MATLABENGINE=1", "MOUNT_MATLAB=1"]'

.github/workflows/matlab-byoi-dockerfile.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/matlab-ubuntu20.04-byoi-dockerfile.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/matlab-ubuntu20.04-dockerfile.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/matlab-ubuntu20.04-mounted-dockerfile.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/matlab-ubuntu20.04-vnc-dockerfile.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/matlab-ubuntu20.04-vnc-mounted-dockerfile.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/matlab-vnc-dockerfile.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/matlab-vnc-mounted-dockerfile.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)