-
Notifications
You must be signed in to change notification settings - Fork 120
Address user feedback and prepare new major version release #207
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
Merged
+100
−32
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6b92294
DES-6613 Create destination dir if it doesn't exist.
zlogic c76e6aa
DES-6665 Fixed Java version detection.
zlogic 50bf803
DES-6613 Bumped up CF Buildpack to v5.0.23.
zlogic 62482c2
Removed unused build_image code.
zlogic 5f6ae00
DES-6613 Updated documentation.
zlogic 96982c2
Added a note about CF Buildpack builds.
zlogic 9b4c66d
Removed confusing BUILD_PATH arg.
zlogic 891c706
Added a note that only WSL Python works in Windows.
zlogic 3ff535a
Addressed internal review comments:
zlogic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Upgrading from Docker Buildpack v5 | ||
|
||
Docker Buildpack v6 contains a breaking change and might require some changes in your CI/CD pipeline: | ||
|
||
Building Mendix projects from source (\*.mpr or \*.mpk files) is now done using a build.py script. | ||
If your CI/CD pipeline uses Docker Buildpack to build \*.mda files (compiled Mendix apps), no further changes are needed. | ||
|
||
If you're upgrading from Docker Buildpack v4 (or an older version), you'll also need to follow the [upgrading from Docker Buildpack v4](upgrading-from-v4.md) instructions. | ||
|
||
⚠️ If your current pipeline is failing with an _Only Ubuntu is supported_ error, your pipeline depends on CF Buildpack to build Mendix MPR files, and needs to be updated as described in this document. | ||
|
||
## Using the build.py script | ||
|
||
Docker Buildpack v6 no longer uses CF Buildpack to compile MPR (or MPK) files - to continue supporting newer versions of Mendix, Java and the base OS. | ||
Instead, a custom `build.py` script will: | ||
|
||
1. Prepare a clean [Docker context](https://docs.docker.com/build/concepts/context/) in the path specified by `--destination`. All files required to build the app image will be copied to this destination. | ||
2. Detect the file type of the source path specified by the `--source` arg (an MPK file, an MPR file, an MDA file or an unpacked MDA directory). | ||
3. If necessary (`--source` specifies project that needs to be compiled) | ||
1. Create an image containing [mxbuild](https://docs.mendix.com/refguide/mxbuild/) and its dependencies. | ||
2. Run an `mxbuild` in a container, and copy the resulting MDA contents to the destination path specified by `--destination`. | ||
4. Otherwise (`--source` specifies a path to an MDA file or unpacked MDA directory), `build.sh` will just copy the MDA contents to the destination path specified by `--destination`. | ||
|
||
Once the `build.py` script runs successfully, the path specified by `--destination` will contain a Docker context and everything needed to run a `docker build` command. | ||
|
||
### Updating an existing pipeline to use build.py | ||
|
||
There instructions are provided as a reference, based on a typical pipeline. Your CI/CD pipeline might be different - for support with updating a custom pipeline, please check the [Mendix Support Policy](https://www.mendix.com/evaluation-guide/evaluation-learning/support/). | ||
|
||
1. Verify your pipeline image or runner has Python 3.8 available, and uses a UNIX-like operating system (Linux, macOS or Windows Subsystem for Linux). | ||
2. Locate the `docker build` step in your CI/CD pipeline that builds the app image. This should be the step that builds the Mendix app, and not the rootfs or its dependencies. Any `docker build` commands that build the rootfs should not be changed. | ||
3. Before the `docker build` step, add the following lines (replacing `<path-to-source>` with the path to the project source, and `<destination-dir>` with an empty/temporary writable path): | ||
```shell | ||
./build.py --source <path-to-source> --destination <destination-dir> build-mda-dir | ||
``` | ||
4. In the `docker build` step: | ||
* Remove `--build-arg BUILD_PATH` args. | ||
* Remove `-f` and `--file` args specifying a Dockerfile, if they exist. | ||
* Update the [Docker context](https://docs.docker.com/build/concepts/context/) path to the `<destination-dir>`. | ||
|
||
After the update, your pipeline might look like this: | ||
|
||
```shell | ||
# Preparation steps | ||
# Downloag Docker Buildpack | ||
DOCKER_BUILDPACK_VERSION=v6.0.0 | ||
curl -LJ -o - https://github.com/mendix/docker-mendix-buildpack/archive/refs/tags/${DOCKER_BUILDPACK_VERSION}.tar.gz | tar --strip-components=1 -xvz | ||
# Checkout the Mendix app source | ||
git clone <mendix-app-git> mendix-app-src | ||
# Build the Mendix app from mendix-app-src to a temporary location | ||
./build.py --source mendix-app-src --destination /tmp/docker-buildpack-context build-mda-dir | ||
# Prepare and push the Docker image, using /tmp/docker-buildpack-context as the Docker context | ||
docker build --tag example.com/mendix-app:latest /tmp/docker-buildpack-context | ||
docker push example.com/mendix-app:latest | ||
# Follow-up steps | ||
``` | ||
|
||
# Other changes | ||
|
||
Docker Buildpack v6 switched from `ubi8` to `ubi9` images ([Red Hat Universal Base Images](https://developers.redhat.com/articles/ubi-faq) whenever possible. | ||
Building Mendix 8 and 9 apps still uses `ubi8`, as those versions depend on an older version of Mono that doesn't work in newer operating systems. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also mention that the if the destaination directory is not created, it will also create the directory