Skip to content

Commit 7a893db

Browse files
authored
Merge pull request #128 from mendix/DES-3298_upgrade-to-cf-buildpack-4.20.0
DES-3298 Fixed CF Buildpack v4.20.0 compatibility
2 parents 63ce142 + 2f7f5c9 commit 7a893db

8 files changed

+18
-9
lines changed

.integrationtest.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ set -eux
33
docker version
44
docker-compose version
55
make get-sample
6+
make build-base-images
67
make build-image
78
tests/test-generic.sh tests/docker-compose-postgres.yml
89
#tests/test-generic.sh tests/docker-compose-sqlserver.yml

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ FROM ${BUILDER_ROOTFS_IMAGE} AS builder
1313
ARG BUILD_PATH=project
1414
ARG DD_API_KEY
1515
# CF buildpack version
16-
ARG CF_BUILDPACK=v4.17.1
16+
ARG CF_BUILDPACK=v4.20.0
1717
# CF buildpack download URL
1818
ARG CF_BUILDPACK_URL=https://github.com/mendix/cf-mendix-buildpack/releases/download/${CF_BUILDPACK}/cf-mendix-buildpack.zip
1919

@@ -35,6 +35,7 @@ ARG USER_UID=1001
3535
# 5. Update ownership of /opt/mendix so that the app can run as a non-root user
3636
# 6. Update permissions of /opt/mendix so that the app can run as a non-root user
3737
RUN mkdir -p /opt/mendix/buildpack /opt/mendix/build &&\
38+
ln -s /root /home/vcap &&\
3839
echo "Downloading CF Buildpack from ${CF_BUILDPACK_URL}" &&\
3940
curl -fsSL ${CF_BUILDPACK_URL} -o /tmp/cf-mendix-buildpack.zip && \
4041
python3 -m zipfile -e /tmp/cf-mendix-buildpack.zip /opt/mendix/buildpack/ &&\
@@ -104,9 +105,9 @@ ENV PYTHONPATH "/opt/mendix/buildpack/lib/:/opt/mendix/buildpack/:/opt/mendix/bu
104105
COPY scripts/startup scripts/vcap_application.json /opt/mendix/build/
105106

106107
# Create vcap home directory for Datadog configuration
107-
RUN mkdir -p /home/vcap &&\
108-
chown -R ${USER_UID}:0 /home/vcap &&\
109-
chmod -R g=u /home/vcap
108+
RUN mkdir -p /home/vcap /opt/datadog-agent/run &&\
109+
chown -R ${USER_UID}:0 /home/vcap /opt/datadog-agent/run &&\
110+
chmod -R g=u /home/vcap /opt/datadog-agent/run
110111

111112
# Each comment corresponds to the script line:
112113
# 1. Make the startup script executable

Dockerfile.rootfs.bionic

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LABEL maintainer="[email protected]"
88
# When doing a full build: install dependencies & remove package lists
99
RUN apt-get -q -y update && \
1010
DEBIAN_FRONTEND=noninteractive apt-get upgrade -q -y && \
11-
DEBIAN_FRONTEND=noninteractive apt-get install -q -y wget curl unzip libpq5 locales python3 python3-distutils libssl1.0.0 libgdiplus nginx-light libnginx-mod-stream && \
11+
DEBIAN_FRONTEND=noninteractive apt-get install -q -y wget curl unzip libpq5 locales python3 python3-distutils libssl1.0.0 libgdiplus nginx-light libnginx-mod-stream binutils && \
1212
rm -rf /var/lib/apt/lists/* && \
1313
apt-get clean
1414

Dockerfile.rootfs.ubi8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ENV LC_ALL C.UTF-8
1313
# doesn't include libpq5 python3-distutils libgdiplus
1414
RUN dnf update -y && \
1515
dnf module enable nginx:1.18 -y && \
16-
dnf install -y wget curl glibc-langpack-en python3 openssl tar gzip unzip nginx nginx-mod-stream fontconfig && \
16+
dnf install -y wget curl glibc-langpack-en python3 openssl tar gzip unzip nginx nginx-mod-stream binutils fontconfig && \
1717
dnf clean all && rm -rf /var/cache/yum
1818

1919
# Set nginx permissions

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
VERSION=$(shell cat docker-buildpack.version)
22
CF_BUILDPACK_VERSION=$(shell cat cf-buildpack.version)
33
ROOTFS_VERSION=$(shell cat rootfs.version)
4+
ROOTFS_IMAGES=$(patsubst Dockerfile.rootfs.%, rootfs.%, $(wildcard Dockerfile.rootfs.*))
45

56
get-sample:
67
if [ -d build ]; then rm -rf build; fi
@@ -9,6 +10,12 @@ get-sample:
910
wget https://s3-eu-west-1.amazonaws.com/mx-buildpack-ci/BuildpackTestApp-mx-7-16.mda -O downloads/application.mpk
1011
unzip downloads/application.mpk -d build/
1112

13+
rootfs.%: Dockerfile.rootfs.%
14+
docker build \
15+
-t mendix/rootfs:$* -f Dockerfile.rootfs.$* .
16+
17+
build-base-images: $(ROOTFS_IMAGES)
18+
1219
build-image:
1320
docker build \
1421
--build-arg BUILD_PATH=build \

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ For build you can provide next arguments:
5757
- **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`.
5858
- **ROOTFS_IMAGE** is a type of rootfs image. Defaults to `mendix/rootfs:ubi8` (Red Hat Universal Base Image 8). To use Ubuntu 18.04, change this to `mendix/rootfs:bionic`. It's also possible to use a custom rootfs image as described in [Advanced feature: full-build](#advanced-feature-full-build).
5959
- **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:bionic`. It's also possible to use a custom rootfs image as described in [Advanced feature: full-build](#advanced-feature-full-build).
60-
- **CF_BUILDPACK** is a version of CloudFoundry buildpack. Defaults to `v4.17.1`. For stable pipelines, it's recommended to use a fixed version from **v4.17.1** and later. CloudFoundry buildpack versions below **v4.17.1** are not supported.
60+
- **CF_BUILDPACK** is a version of CloudFoundry buildpack. Defaults to `v4.20.0`. For stable pipelines, it's recommended to use a fixed version from **v4.20.0** and later. CloudFoundry buildpack versions below **v4.20.0** are not supported.
6161
- **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.
6262
- **UNINSTALL_BUILD_DEPENDENCIES** will uninstall packages which are not needed to launch an app, and are only used during the build phase. Defaults to `true`. This option will remove several libraries which are known to have unpatched CVE vulnerabilities.
6363
- **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**.

cf-buildpack.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v4.17.1
1+
v4.20.0

docker-buildpack.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v3.2.0
1+
v3.4.0

0 commit comments

Comments
 (0)