Skip to content

Commit 02151a2

Browse files
authored
Merge pull request #170 from mendix/DES-4896_upgrade-rootfs
Upgrade to Python 3.11
2 parents c20a7b8 + 3649246 commit 02151a2

File tree

8 files changed

+160
-64
lines changed

8 files changed

+160
-64
lines changed

Dockerfile

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Mendix Deployment Archive (aka mda file)
33
#
44
# Author: Mendix Digital Ecosystems, [email protected]
5-
# Version: 2.1.0
5+
# Version: 5.1.0
66
ARG ROOTFS_IMAGE=mendix-rootfs:app
77
ARG BUILDER_ROOTFS_IMAGE=mendix-rootfs:builder
88

@@ -12,10 +12,6 @@ FROM ${BUILDER_ROOTFS_IMAGE} AS builder
1212
# Build-time variables
1313
ARG BUILD_PATH=project
1414
ARG DD_API_KEY
15-
# CF buildpack version
16-
ARG CF_BUILDPACK=v4.30.17
17-
# CF buildpack download URL
18-
ARG CF_BUILDPACK_URL=https://github.com/mendix/cf-mendix-buildpack/releases/download/${CF_BUILDPACK}/cf-mendix-buildpack.zip
1915

2016
# Exclude the logfilter binary by default
2117
ARG EXCLUDE_LOGFILTER=true
@@ -24,38 +20,9 @@ ARG EXCLUDE_LOGFILTER=true
2420
ARG BLOBSTORE
2521
ARG BUILDPACK_XTRACE
2622

27-
# Set the user ID
28-
ARG USER_UID=1001
29-
30-
# Each comment corresponds to the script line:
31-
# 1. Create all directories needed by scripts
32-
# 2. Download CF buildpack
33-
# 3. Extract CF buildpack
34-
# 4. Delete CF buildpack zip archive
35-
# 5. Update ownership of /opt/mendix so that the app can run as a non-root user
36-
# 6. Update permissions of /opt/mendix so that the app can run as a non-root user
37-
RUN mkdir -p /opt/mendix/buildpack /opt/mendix/build &&\
38-
ln -s /root /home/vcap &&\
39-
mkdir -p /home/vcap/.local/bin && ln -s /etc/alternatives/pip3 /home/vcap/.local/bin/pip && pip3 install --upgrade pip &&\
40-
echo "Downloading CF Buildpack from ${CF_BUILDPACK_URL}" &&\
41-
curl -fsSL ${CF_BUILDPACK_URL} -o /tmp/cf-mendix-buildpack.zip && \
42-
python3 -m zipfile -e /tmp/cf-mendix-buildpack.zip /opt/mendix/buildpack/ &&\
43-
rm /tmp/cf-mendix-buildpack.zip &&\
44-
chown -R ${USER_UID}:0 /opt/mendix &&\
45-
chmod -R g=u /opt/mendix
46-
47-
# Copy python scripts which execute the buildpack (exporting the VCAP variables)
48-
COPY scripts/compilation.py scripts/git /opt/mendix/buildpack/
49-
5023
# Copy project model/sources
5124
COPY $BUILD_PATH /opt/mendix/build
5225

53-
# Install the buildpack Python dependencies
54-
RUN chmod +rx /opt/mendix/buildpack/bin/bootstrap-python && /opt/mendix/buildpack/bin/bootstrap-python /opt/mendix/buildpack /tmp/buildcache
55-
56-
# Add the buildpack modules
57-
ENV PYTHONPATH "$PYTHONPATH:/opt/mendix/buildpack/lib/:/opt/mendix/buildpack/:/opt/mendix/buildpack/lib/python3.6/site-packages/"
58-
5926
# Use nginx supplied by the base OS
6027
ENV NGINX_CUSTOM_BIN_PATH=/usr/sbin/nginx
6128

@@ -91,7 +58,7 @@ RUN chmod g=u /etc/passwd &&\
9158
chown ${USER_UID}:0 /etc/passwd
9259

9360
# Add the buildpack modules
94-
ENV PYTHONPATH "/opt/mendix/buildpack/lib/:/opt/mendix/buildpack/:/opt/mendix/buildpack/lib/python3.6/site-packages/"
61+
ENV PYTHONPATH "/opt/mendix/buildpack/lib/:/opt/mendix/buildpack/:/opt/mendix/buildpack/lib/python3.11/site-packages/"
9562

9663
# Copy start scripts
9764
COPY scripts/startup.py scripts/vcap_application.json /opt/mendix/build/
@@ -113,12 +80,6 @@ RUN chmod +rx /opt/mendix/build/startup.py &&\
11380

11481
USER ${USER_UID}
11582

116-
# Copy jre from build container
117-
COPY --from=builder /var/mendix/build/.local/usr /opt/mendix/build/.local/usr
118-
119-
# Copy Mendix Runtime from build container
120-
COPY --from=builder /var/mendix/build/runtimes /opt/mendix/build/runtimes
121-
12283
# Copy build artifacts from build container
12384
COPY --from=builder /opt/mendix /opt/mendix
12485

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ This project is a goto reference for the following scenarios :
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)
4545
* For preparing, a local installation of `curl`
4646
* For local testing, make sure you can run the [docker-compose command](https://docs.docker.com/compose/install/)
47-
* A Mendix app based on Mendix 7 or a later version
47+
* A Mendix app based on Mendix 8 or a later version
4848

4949
## Usage
5050

@@ -80,6 +80,12 @@ docker push <builder-root-fs-image-tag>
8080
docker push <app-root-fs-image-tag>
8181
```
8282

83+
When building the the `rootfs-builder.dockerfile` file, you can provide the following additional arguments:
84+
85+
- **CF_BUILDPACK** is a version of CloudFoundry buildpack. Defaults to `v5.0.0`. For stable pipelines, it's recommended to use a fixed **v5.0.0** version. Other Cloud Foundry buildpacks might not work with this version of Docker Buildpack.
86+
- **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**.
87+
- **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.
88+
8389
### Compile an app
8490

8591
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/).
@@ -95,9 +101,7 @@ For build you can provide next arguments:
95101
- **BUILD_PATH** indicates where the application model is located. It is a root directory of an unzipped .MDA or .MPK file. In the latter case, this is the directory where your .MPR file is located. Must be within [build context](https://docs.docker.com/engine/reference/commandline/build/#extended-description). Defaults to `./project`.
96102
- **ROOTFS_IMAGE** is a type of rootfs image. Defaults to `mendix-rootfs:app` (a locally prebuilt image).
97103
- **BUILDER_ROOTFS_IMAGE** is a type of rootfs image used for downloading the Mendix app dependencies and compiling the Mendix app from source. Defaults to `mendix-rootfs:builder` (a locally prebuilt image).
98-
- **CF_BUILDPACK** is a version of CloudFoundry buildpack. Defaults to `v4.30.17`. For stable pipelines, it's recommended to use a fixed version from **v4.30.17** and later. CloudFoundry buildpack versions below **v4.30.17** are not supported.
99104
- **EXCLUDE_LOGFILTER** will exclude the `mendix-logfilter` binary from the resulting Docker image if set to `true`. Defaults to `true`. Excluding `mendix-logfilter` will reduce the image size and remove a component that's not commonly used; the `LOG_RATELIMIT` environment variable option will be disabled.
100-
- **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**.
101105
- **BLOBSTORE** can be used to specify an alternative buildpack resource server (instead of the default Mendix CDN). For more information, see the [CF Buildpack offline settings](https://github.com/mendix/cf-mendix-buildpack#offline-buildpack-settings).
102106
- **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.
103107

rootfs-app.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ENV LC_ALL C.UTF-8
1212
# install dependencies & remove package lists
1313
RUN microdnf update -y && \
1414
microdnf module enable nginx:1.20 -y && \
15-
microdnf install -y glibc-langpack-en python3 openssl nginx nginx-mod-stream fontconfig && \
15+
microdnf install -y glibc-langpack-en python311 openssl nginx nginx-mod-stream java-11-openjdk-headless fontconfig && \
1616
microdnf clean all && rm -rf /var/cache/yum
1717

1818
# Set nginx permissions

rootfs-builder.dockerfile

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,31 @@ LABEL maintainer="[email protected]"
99
ENV LANG C.UTF-8
1010
ENV LC_ALL C.UTF-8
1111

12+
# CF buildpack version
13+
ARG CF_BUILDPACK=v5.0.0
14+
# CF buildpack download URL
15+
ARG CF_BUILDPACK_URL=https://github.com/mendix/cf-mendix-buildpack/releases/download/${CF_BUILDPACK}/cf-mendix-buildpack.zip
16+
17+
# Set the user ID
18+
ARG USER_UID=1001
19+
ENV USER_UID=${USER_UID}
20+
21+
# Allow specification of debugging options
22+
ARG BUILDPACK_XTRACE
23+
24+
# Add mono repo
25+
COPY --chown=0:0 scripts/mono/xamarin.gpg /etc/pki/rpm-gpg/RPM-GPG-KEY-mono-centos8-stable
26+
COPY --chown=0:0 scripts/mono/mono-centos8-stable.repo /etc/yum.repos.d/mono-centos8-stable.repo
27+
1228
# install dependencies & remove package lists
1329
RUN rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm &&\
1430
microdnf update -y && \
1531
microdnf module enable nginx:1.20 -y && \
16-
microdnf install -y wget curl glibc-langpack-en python3 python3-setuptools openssl libgdiplus tar gzip unzip libpq nginx nginx-mod-stream binutils fontconfig libicu findutils && \
32+
microdnf install -y wget curl glibc-langpack-en python311 openssl tar gzip unzip libpq nginx nginx-mod-stream binutils fontconfig findutils && \
33+
microdnf clean all && rm -rf /var/cache/yum
34+
35+
# Install RHEL alternatives to CF Buildpack dependencies
36+
RUN microdnf install -y java-11-openjdk-headless java-11-openjdk-devel mono-core-5.20.1.34 libgdiplus0 libicu && \
1737
microdnf clean all && rm -rf /var/cache/yum
1838

1939
# Set nginx permissions
@@ -22,8 +42,41 @@ RUN touch /run/nginx.pid && \
2242
chmod -R g=u /var/log/nginx /var/lib/nginx /run/nginx.pid
2343

2444
# Pretend to be Ubuntu to bypass CF Buildpack's check
25-
RUN rm /etc/*-release && echo 'Ubuntu release 18.04 (Bionic)' > /etc/debian-release
45+
RUN rm /etc/*-release && printf 'NAME="Ubuntu"\nID=ubuntu\nVersion="22.04 LTS (Jammy Jellyfish)"\nVERSION_CODENAME=jammy\n' > /etc/os-release
2646

2747
# Set python alias to python3 (required for Datadog)
2848
RUN alternatives --set python /usr/bin/python3
2949

50+
# Download and prepare CF Buildpack
51+
52+
# Switch CF Buildpack to use Python 3.10+ compatibility
53+
ENV CF_STACK cflinuxfs4
54+
55+
# Each comment corresponds to the script line:
56+
# 1. Create all directories needed by scripts
57+
# 2. Download CF buildpack
58+
# 3. Extract CF buildpack
59+
# 4. Delete CF buildpack zip archive
60+
# 5. Update ownership of /opt/mendix so that the app can run as a non-root user
61+
# 6. Update permissions of /opt/mendix so that the app can run as a non-root user
62+
RUN mkdir -p /opt/mendix/buildpack /opt/mendix/build &&\
63+
ln -s /root /home/vcap &&\
64+
echo "Downloading CF Buildpack from ${CF_BUILDPACK_URL}" &&\
65+
curl -fsSL ${CF_BUILDPACK_URL} -o /tmp/cf-mendix-buildpack.zip && \
66+
python3 -m zipfile -e /tmp/cf-mendix-buildpack.zip /opt/mendix/buildpack/ &&\
67+
rm /tmp/cf-mendix-buildpack.zip &&\
68+
chown -R ${USER_UID}:0 /opt/mendix &&\
69+
chmod -R g=u /opt/mendix
70+
71+
# Copy python scripts which execute the buildpack (exporting the VCAP variables)
72+
COPY scripts/compilation.py scripts/git /opt/mendix/buildpack/
73+
74+
# Install the buildpack Python dependencies
75+
RUN PYTHON_BUILD_RPMS="python3.11-pip python3.11-devel libffi-devel gcc" && \
76+
microdnf install -y $PYTHON_BUILD_RPMS && \
77+
rm /opt/mendix/buildpack/vendor/wheels/* && \
78+
chmod +rx /opt/mendix/buildpack/bin/bootstrap-python && /opt/mendix/buildpack/bin/bootstrap-python /opt/mendix/buildpack /tmp/buildcache && \
79+
microdnf remove -y $PYTHON_BUILD_RPMS && microdnf clean all && rm -rf /var/cache/yum
80+
81+
# Add the buildpack modules
82+
ENV PYTHONPATH "$PYTHONPATH:/opt/mendix/buildpack/lib/:/opt/mendix/buildpack/:/opt/mendix/buildpack/lib/python3.11/site-packages/"

scripts/compilation.py

Lines changed: 47 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
import runpy
66
import sys
77
import shutil
8+
import tarfile
89

910
from buildpack import util
1011
from buildpack.core import java, runtime
12+
from buildpack.util import get_dependency
1113

1214
logging.basicConfig(
1315
level=logging.INFO,
@@ -29,6 +31,50 @@ def export_vcap_services():
2931
os.environ['VCAP_SERVICES'] = vcap_services_str
3032
os.environ["PATH"] += os.pathsep + "/opt/mendix/buildpack"
3133

34+
def replace_cf_dependencies():
35+
logging.debug("Ensuring CF Buildpack dependencies are available")
36+
37+
# Only mono 5 is supported by Docker Buildpack
38+
mono_dependency = get_dependency("mono.5-jammy", "/opt/mendix/buildpack")
39+
logging.debug("Creating symlink for mono {0}".format(mono_dependency['artifact']))
40+
41+
util.mkdir_p("/tmp/buildcache/bust")
42+
mono_cache_artifact = f"/tmp/buildcache/bust/mono-{mono_dependency['version']}-mx-ubuntu-jammy.tar.gz"
43+
with tarfile.open(mono_cache_artifact, "w:gz") as tar:
44+
# Symlinks to use mono from host OS
45+
symlinks = {'mono/bin':'/usr/bin', 'mono/lib': '/usr/lib64', 'mono/etc': '/etc'}
46+
for source, destination in symlinks.items():
47+
symlink = tarfile.TarInfo(source)
48+
symlink.type = tarfile.SYMTYPE
49+
symlink.linkname = destination
50+
tar.addfile(symlink)
51+
52+
# Only JDK 11 is supported by Docker Buildpack
53+
jdk_dependency = get_dependency("java.11-jdk", "/opt/mendix/buildpack")
54+
logging.debug("Creating symlink for jdk {0}".format(jdk_dependency['artifact']))
55+
jdk_cache_artifact = f"/tmp/buildcache/bust/{jdk_dependency['artifact']}"
56+
jdk_destination = '/etc/alternatives/java_sdk_11'
57+
with tarfile.open(jdk_cache_artifact, "w:gz") as tar:
58+
# Symlinks to use jdk from host OS
59+
for jdk_dir in os.listdir(jdk_destination):
60+
symlink = tarfile.TarInfo(f"jdk/{jdk_dir}")
61+
symlink.type = tarfile.SYMTYPE
62+
symlink.linkname = f"{jdk_destination}/{jdk_dir}"
63+
tar.addfile(symlink)
64+
65+
# Only JRE 11 is supported by Docker Buildpack
66+
jre_dependency = get_dependency("java.11-jre", "/opt/mendix/buildpack")
67+
logging.debug("Creating symlink for jre {0}".format(jre_dependency['artifact']))
68+
jre_cache_artifact = f"/tmp/buildcache/bust/{jre_dependency['artifact']}"
69+
jre_destination = '/etc/alternatives/jre_11'
70+
with tarfile.open(jre_cache_artifact, "w:gz") as tar:
71+
# Symlinks to use jre from host OS
72+
for jre_dir in os.listdir(jre_destination):
73+
symlink = tarfile.TarInfo(f"jre/{jre_dir}")
74+
symlink.type = tarfile.SYMTYPE
75+
symlink.linkname = f"{jre_destination}/{jre_dir}"
76+
tar.addfile(symlink)
77+
3278
def call_buildpack_compilation():
3379
logging.debug("Executing call_buildpack_compilation...")
3480
return runpy.run_module("buildpack.stage", run_name="__main__")
@@ -41,25 +87,10 @@ def fix_logfilter():
4187
else:
4288
os.chmod("/opt/mendix/build/.local/mendix-logfilter/mendix-logfilter", 0o0755)
4389

44-
def make_dependencies_reusable(compilation_globals):
45-
logging.info("Making dependencies reusable...")
46-
dot_local_location = compilation_globals["DOT_LOCAL_LOCATION"]
47-
build_path = compilation_globals["BUILD_DIR"]
48-
shutil.move("/opt/mendix/build/runtimes", "/var/mendix/build/")
49-
shutil.move("/opt/mendix/build/.local/usr", "/var/mendix/build/.local/")
50-
# separate cacerts from reusable jre components
51-
jre = java._get_java_dependency(java.get_java_major_version(runtime.get_runtime_version(build_path)), 'jre')
52-
jvm_location_reusable = os.path.join("/var/mendix/build/.local/", java._compose_jvm_target_dir(jre))
53-
jvm_location_customized = os.path.join(dot_local_location, java._compose_jvm_target_dir(jre))
54-
cacerts_file_source = os.path.join(jvm_location_reusable, "lib", "security", "cacerts")
55-
cacerts_file_target = os.path.join(jvm_location_customized, "lib", "security", "cacerts")
56-
util.mkdir_p(os.path.dirname(cacerts_file_target))
57-
os.rename(cacerts_file_source, cacerts_file_target)
58-
5990
if __name__ == '__main__':
6091
logging.info("Mendix project compilation phase...")
6192

6293
export_vcap_services()
94+
replace_cf_dependencies()
6395
compilation_globals = call_buildpack_compilation()
6496
fix_logfilter()
65-
make_dependencies_reusable(compilation_globals)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[mono-centos8-stable]
2+
name=mono-centos8-stable
3+
baseurl=https://download.mono-project.com/repo/centos8-stable/
4+
enabled=1
5+
gpgcheck=1
6+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mono-centos8-stable

scripts/mono/xamarin.gpg

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
-----BEGIN PGP PUBLIC KEY BLOCK-----
2+
Version: GnuPG v1
3+
4+
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
35+
D5BxWL9l7HU=
36+
=RDbl
37+
-----END PGP PUBLIC KEY BLOCK-----

upgrading-from-v4.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Docker Buildpack v5 contains some breaking changes and will require some changes
44

55
* rootfs images are no longer published to Docker Hub.
66
* rootfs images are now based on [Red Hat Universal Base Image 8 minimal](https://developers.redhat.com/articles/ubi-faq) image.
7+
* CF Buildpack is packaged directly into the build image.
8+
* Mendix 7 and older versions are no longer supported. To use Docker Buildpack v5, upgrade your app to Mendix 8 or a later version.
79

810
## Building rootfs images
911

@@ -15,7 +17,7 @@ In the past, Docker Buildpack offered two types of rootfs images: `bionic` and `
1517
With Docker Buildpack v5, all images are now based on ubi8-minimal:
1618

1719
* `app` images contain only components that are required to run an app. Build-time components such as `tar`, compilers or Mono prerequisites are excluded - reducing the image size and excluding components that could increase the number of unpatched CVEs in the final image
18-
* `builder` images contain additional components that are only required when compiling a Mendix app.
20+
* `builder` images contain CF Buildpack and additional components that are only required when compiling a Mendix app.
1921

2022
You will need to update your pipelines to build these prerequisite images and (optionally) push them to your private registry.
2123

@@ -32,6 +34,7 @@ In this case, your build pipeline needs to be adjusted:
3234
docker build -t mendix-rootfs:builder -f rootfs-builder.dockerfile .
3335
```
3436
2. When building the Mendix app itself, use the default values for `ROOTFS_IMAGE` and `BUILDER_ROOTFS_IMAGE` (remove any custom `--build-arg ROOTFS_IMAGE=...` and `--build-arg BUILDER_ROOTFS_IMAGE=...` arguments from the `docker build` command)
37+
3. If you need to use a specific version of CF Buildpack via `CF_BUILDPACK` or `CF_BUILDPACK_URL` arguments, these arguments should be specified when building the `rootfs-builder.dockerfile` image, **not** your app image.
3538

3639
### Option 2: build rootfs images centrally
3740

@@ -55,6 +58,7 @@ In this case, you need to make the following changes in your CI/CD process:
5558
--build-arg BUILDER_ROOTFS_IMAGE={your-private-registry}/mendix-rootfs:builder \
5659
--tag {your-private-registry}/my-app:latest .
5760
```
61+
3. If you need to use a specific version of CF Buildpack via `CF_BUILDPACK` or `CF_BUILDPACK_URL` arguments, these arguments should be specified when building the `rootfs-builder.dockerfile` image, **not** your app image.
5862

5963
## Migrating from Ubuntu to Red Hat UBI
6064

0 commit comments

Comments
 (0)