You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Inherited" workspaces - airlock-import-review, unrestricted workspaces and our own custom workspaces - are built on top of the base workspace's code, to reduce duplication.
The base workspace code is pulled in in the inherited workspace's Dockerfile.tmpl file:
# Copy all files from base workspace (note: some of them will be overwritten with the following COPY command)
RUN curl -o azuretre.tar.gz -L "https://github.com/microsoft/AzureTRE/archive/refs/tags/v${AZURE_TRE_VERSION}.tar.gz" \
&& tar -xzf azuretre.tar.gz "AzureTRE-${AZURE_TRE_VERSION}/templates/workspaces/base" --strip-components=4 --skip-old-files \
&& rm -rf azuretre.tar.gz
The code is downloaded from a tagged version of the Azure TRE on GitHub, rather than by referencing the local copy of the base workspace, as the Docker build context does not allow access outside of the current working directory (the docker "build context").
This is unsatisfactory as every time the base workspace changes, for the change to be propagated to inherited workspaces, a versioned release of the Azure TRE is required, and then a subsequent commit is required to update this version number in inherited workspaces. Consequently inherited workspaces typically lag behind the base workspace by several versions as this step is often missed.
Proposed solution
Rather than pulling the base workspace code from a tagged release on GitHub, use the local base workspace code in the ../base workspace directory.
docker build now allows a --build-context parameter to be passed to containing additional named build contexts, which allows the referencing of files outside of the current build context.
In order for the above to be used a change to porter would be required to allow the passing of the --build-context parameter to the docker build command.
The text was updated successfully, but these errors were encountered:
jonnyry
changed the title
Change the way workspaces that inherit from the base workspace pull the base workspace code
Change the way "inherited" workspaces retrieve the base workspace code
Dec 3, 2024
@jonnyry completely agree, didn't realise could have multiple build contexts. When did this happen? As you say I think a PR to porter would be required to enable this.
Problem
"Inherited" workspaces - airlock-import-review, unrestricted workspaces and our own custom workspaces - are built on top of the base workspace's code, to reduce duplication.
The base workspace code is pulled in in the inherited workspace's Dockerfile.tmpl file:
AzureTRE/templates/workspaces/airlock-import-review/Dockerfile.tmpl
Lines 16 to 19 in b69ab01
The code is downloaded from a tagged version of the Azure TRE on GitHub, rather than by referencing the local copy of the base workspace, as the Docker build context does not allow access outside of the current working directory (the docker "build context").
This is unsatisfactory as every time the base workspace changes, for the change to be propagated to inherited workspaces, a versioned release of the Azure TRE is required, and then a subsequent commit is required to update this version number in inherited workspaces. Consequently inherited workspaces typically lag behind the base workspace by several versions as this step is often missed.
Proposed solution
Rather than pulling the base workspace code from a tagged release on GitHub, use the local base workspace code in the
../base
workspace directory.docker build
now allows a--build-context
parameter to be passed to containing additional named build contexts, which allows the referencing of files outside of the current build context.https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#-additional-build-contexts---build-context
This would then allow the COPY command to be used as follows:
In order for the above to be used a change to porter would be required to allow the passing of the
--build-context
parameter to thedocker build
command.The text was updated successfully, but these errors were encountered: