Make sure you’re logged in to your container registry. In case if you don’t have access to a container registry, you can make use of the Docker Registry Community Module from Kyma.
If you’re using a device with a non-x86 processor (for example, MacBook M1/M2), you need to instruct Docker to use x86 images by setting the DOCKER_DEFAULT_PLATFORM environment variable using the command export DOCKER_DEFAULT_PLATFORM=linux/amd64. Check the environment variables for more information.
Make sure to replace <your-container-registry> with the link to your container registry and keep in mind that <image version> is a string.
Looking for your Docker server URL?
The Docker server URL is the same as the path used for Docker login, so you can quickly check it by running the following command in your terminal:
cat ~/.docker/config.json
In case you’re using Docker Hub as your container registry, replace the placeholder <your-container-registry> with your Docker Hub user ID.
Build the CAP Node.js and the MTXS sidecar image
-
In VS Code, choose Terminal → New Terminal and run the following command:
npm install
This command installs the required dependencies and updates the package-lock.json file of your project.
-
Create the productive CAP build for your application:
npx cds build --production
The CAP build writes to the gen/srv folder.
-
Build the CAP Node.js image:
pack build <your-container-registry>/incident-management-srv:<image-version> \
--path gen/srv \
--builder paketobuildpacks/builder-jammy-base \
--publish
The pack CLI builds the image that contains the build result in the gen/srv folder and the required npm packages by using the Cloud Native Buildpack for Node.js provided by Paketo.
-
Build the MTXS sidecar image:
pack build <your-container-registry>/incident-management-mtxs-sidecar:<image-version> \
--path gen/mtx/sidecar \
--builder paketobuildpacks/builder-jammy-base \
--publish
IMPORTANT: The project.toml file in the gen/mtx/sidecar folder is copied automatically from the mtxs/sidecar folder during the build. This file exposes the node process inside the container so that CAP Operator can trigger tenant operations using the MTXS CLIs.
Build the application router image
-
In the VS Code terminal, navigate to the app/router folder and run the following command:
npm install
-
In the VS Code terminal, navigate back to the root folder of your project:
cd ../..
-
Build the application router image:
pack build <your-container-registry>/incident-management-approuter:<image-version> \
--path app/router \
--buildpack paketo-buildpacks/nodejs \
--builder paketobuildpacks/builder-jammy-base \
--env BP_NODE_RUN_SCRIPTS="" \
--publish
Build the HTML5 deployer image
-
In the VS Code terminal, navigate to the ui-resources folder and run the following command:
npm install && npm run package
This command builds and copies the archive nsincidents.zip inside the ui-resources/resources folder.
-
In the VS Code terminal, navigate back to the root folder of your project:
cd ..
-
Build the UI deployer image:
pack build <your-container-registry>/incident-management-html5-deployer:<image-version> \
--path ui-resources \
--builder paketobuildpacks/builder-jammy-base \
--publish