From 37d6c40fcdf42ba528eb8fcd599d11c8c33ae0fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20Gonz=C3=A1lez?= Date: Wed, 20 Dec 2023 09:17:36 -0500 Subject: [PATCH] feat: add patch at the end of the production layer The `mfe-dockerfile-production-final` patch allows you to add instructions to the end of the final layer. This is useful in the case you want to override the default CMD or ENTRYPOINT instructions. --- README.rst | 6 ++++++ ...20_054305_moisesgsalas.add_docker_final_patch.md | 13 +++++++++++++ tutormfe/templates/mfe/build/mfe/Dockerfile | 2 ++ 3 files changed, 21 insertions(+) create mode 100644 changelog.d/20231220_054305_moisesgsalas.add_docker_final_patch.md diff --git a/README.rst b/README.rst index 4c83613e..588e4424 100644 --- a/README.rst +++ b/README.rst @@ -424,6 +424,12 @@ Example: ``mfe-dockerfile-pre-npm-install-learning`` will only apply any instruc File changed: ``tutormfe/templates/mfe/build/mfe/Dockerfile`` +mfe-dockerfile-production-final +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Add any instructions in the final layer. Useful for overriding the CMD or ENTRYPOINT. + +File changed: ``tutormfe/templates/mfe/build/mfe/Dockerfile`` + mfe-dockerfile-post-npm-install ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Add any instructions for after the npm install has completed. This will apply the instructions to every MFE. For an example on the usage of this patch, check out `here <#mfe-docker-post-npm-install>`_. diff --git a/changelog.d/20231220_054305_moisesgsalas.add_docker_final_patch.md b/changelog.d/20231220_054305_moisesgsalas.add_docker_final_patch.md new file mode 100644 index 00000000..48468287 --- /dev/null +++ b/changelog.d/20231220_054305_moisesgsalas.add_docker_final_patch.md @@ -0,0 +1,13 @@ + + + + + +- [Feature] Add a new `mfe-dockerfile-production-final` patch to define additional instructions in the final image. (by @MoisesGSalas) diff --git a/tutormfe/templates/mfe/build/mfe/Dockerfile b/tutormfe/templates/mfe/build/mfe/Dockerfile index d637d97a..732000f2 100644 --- a/tutormfe/templates/mfe/build/mfe/Dockerfile +++ b/tutormfe/templates/mfe/build/mfe/Dockerfile @@ -111,3 +111,5 @@ RUN mkdir -p /openedx/dist {% for app_name, app in iter_mfes() %} COPY --from={{ app_name }}-prod /openedx/app/dist /openedx/dist/{{ app_name }} {% endfor %} + +{{ patch("mfe-dockerfile-production-final") }}