Docker has become increasingly popular in today’s development lifecycle, by providing an automated way to package software and its dependencies into a standardized unit that can be shared cross-platform. Read Docker’s extensive documentation to learn more.
Liferay provides Docker images for
You can pull Liferay’s Docker images from those resources and manage them yourself. Liferay Workspace, however, provides an easy way to integrate Docker development into your existing development workflow with preconfigured Gradle tasks.
The following Docker commands (Gradle-based) are available in Liferay Workspace:
Command | Description |
---|---|
buildDockerImage | Builds the Docker image with all modules/configurations deployed. |
createDockerContainer | Creates a Docker container from the Liferay DXP image and mounts the workspace’s /build/docker folder to the container’s /etc/liferay folder. |
createDockerfile | Creates a Dockerfile to build the Docker image. |
dockerDeploy | Deploys the project to the container’s deploy folder by copying the project archive file to workspace’s build/docker/deploy folder. This command can also be executed from workspace’s root folder to deploy all projects and copy all Docker configurations (i.e., from the configs/common and configs/docker folders) to the container. |
logsDockerContainer | Prints the portal runtime’s logs. You can exit log tracking mode while maintaining a running container (e.g., [Ctrl|Command] + C). |
pullDockerImage | Pulls the Docker image. |
removeDockerContainer | Removes the container from Docker’s system. |
startDockerContainer | Starts the Docker container. |
stopDockerContainer | Stops the Docker container. |
In this section, you’ll learn how to
- Create a Docker container based on a provided Liferay DXP image.
- Configure the container.
- Build a custom image.
Continue on to learn more.