Skip to content

Commit 4a2940c

Browse files
committed
Updated documentation how to use build.py.
1 parent 5349ecf commit 4a2940c

1 file changed

Lines changed: 30 additions & 1 deletion

File tree

README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ This project is a goto reference for the following scenarios :
4242
* Docker 20.10 (Installation [here](https://docs.docker.com/engine/installation/))
4343
* Earlier Docker versions are no longer compatible because they don't support multistage builds.
4444
To use Docker versions below 20.10, download an earlier Mendix Docker Buildpack release, such as [v2.3.2](https://github.com/mendix/docker-mendix-buildpack/releases/tag/v2.3.2)
45+
* Python 3
4546
* For preparing, a local installation of `curl`
4647
* For local testing, make sure you can run the [docker-compose command](https://docs.docker.com/compose/install/)
4748
* A Mendix app based on Mendix 8 or a later version
@@ -86,7 +87,35 @@ When building the the `rootfs-builder.dockerfile` file, you can provide the foll
8687
- **CF_BUILDPACK_URL** specifies the URL where the CF buildpack should be downloaded from (for example, a local mirror). Defaults to `https://github.com/mendix/cf-mendix-buildpack/releases/download/${CF_BUILDPACK}/cf-mendix-buildpack.zip`. Specifying **CF_BUILDPACK_URL** will override the version from **CF_BUILDPACK**.
8788
- **BUILDPACK_XTRACE** can be used to enable CF Buildpack [debug logging](https://github.com/mendix/cf-mendix-buildpack#logging-and-debugging). Set this variable to `true` to enable debug logging.
8889

89-
### Compile an app
90+
### Compile an MDA
91+
92+
If your app is a source MPK file, an MPR project directory or a compressed MDA file, it needs to be converted or compiled into a format supported by CF Buildpack - an extracted MDA file.
93+
94+
This feature is available in Docker Buildpack version v5.1.0 and later, and is intended to allow building Mendix 10 apps in custom CI/CD pipelines.
95+
96+
To do this, run:
97+
98+
```shell
99+
./build.py --source <path-to-source> --destination <destination-dir> build-mda-dir
100+
```
101+
102+
where:
103+
104+
- **--source** is the path to the project source, such as a project directory (with a source MPR project) or an MPK file.
105+
- **--destination** is a path to an empty directory where the script should output the build result. This directory will contain
106+
* a compiled, extracted MDA file - in a subdirectory called `project`.
107+
* a copy of the `Dockerfile` and the `scripts` directory.
108+
- **--artifacts-repository** - an optional repository to cache MxBuild and Mono build images, for example `quay.io/example/mxbuild-artifacts`. By enabling this option, the `build.py` script will try to use a prebuilt image from this repository if available.
109+
110+
After the `build.py` script completes, you can proceed with building the app image by running the following command (see next section for more details):
111+
112+
```shell
113+
docker build --tag mendix/mendix-buildpack:v1.2 <destination-dir>
114+
```
115+
116+
where `<destination-dir>` is the same as used when calling `build.py`.
117+
118+
### Build an image from an MDA
90119

91120
Before running the container, it is necessary to build the image with your application. This buildpack contains Dockerfile with a script that will compile your application using [cf-mendix-buildpack](https://github.com/mendix/cf-mendix-buildpack/).
92121

0 commit comments

Comments
 (0)