Skip to content

Commit

Permalink
feat: add patch at the end of the production layer
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
MoisesGSalas authored and regisb committed Jan 8, 2024
1 parent d39f5be commit 19efd6c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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>`_.
Expand Down
13 changes: 13 additions & 0 deletions changelog.d/20231220_054305_moisesgsalas.add_docker_final_patch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

<!--
Create a changelog entry for every new user-facing change. Please respect the following instructions:
- Indicate breaking changes by prepending an explosion 💥 character.
- Prefix your changes with either [Bugfix], [Improvement], [Feature], [Security], [Deprecation].
- You may optionally append "(by @<author>)" at the end of the line, where "<author>" is either one (just one)
of your GitHub username, real name or affiliated organization. These affiliations will be displayed in
the release notes for every release.
-->

<!-- - 💥[Feature] Foobarize the blorginator. This breaks plugins by renaming the `FOO_DO` filter to `BAR_DO`. (by @regisb) -->
<!-- - [Improvement] This is a non-breaking change. Life is good. (by @billgates) -->
- [Feature] Add a new `mfe-dockerfile-production-final` patch to define additional instructions in the final image. (by @MoisesGSalas)
2 changes: 2 additions & 0 deletions tutormfe/templates/mfe/build/mfe/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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") }}

0 comments on commit 19efd6c

Please sign in to comment.