-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change the way "inherited" workspaces retrieve the base workspace code #4162
Comments
@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. |
Looks like it was sometime in 2022 with the release of Dockerfile 1.4: https://www.docker.com/blog/dockerfiles-now-support-multiple-build-contexts/ I've opened a PR with Porter to support the |
Addition to the solution so that
In all other cases, the The |
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: