Using Liferay Docker Images¶
- Container Lifecycle and API
- Configuring Containers
- JVM Options
- Portal Properties
- Image-Defined Environment Variables
- System Properties
- System Settings
- Additional Information
- Installing Apps and Other Artifacts to Containers
- Licensing DXP in Docker
- Patching DXP in Docker
- Running Scripts in Containers
- Providing Files to the Container
- Upgrading to a New Docker Image
- Docker Image Versions
These containers are standard Docker containers that can be started and stopped as such. The following examples use Docker CLI (
docker), but you can use whatever Docker container tools you like.
Starting a Container for the First Time¶
The containers listens on port
8080 and starts like all Docker containers.
Run a container that maps a host port (e.g.,
8080) to the container’s
docker run -it -m 8g -p 8080:8080 liferay/portal:18.104.22.168-ga29
The container runs and prints log messages, including this Tomcat startup completion message:
INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [xx,xxx] milliseconds
Memory, CPUs, and other Docker container resources are configurable. The
-m 8gcommand arguments above set the container’s memory limit to eight gigabytes. See the Docker runtime options for details.
Sign in to Liferay at
<http://localhost:8080>using the email address firstname.lastname@example.org and the password test. When prompted, change your password.
Liferay is ready to use.
docker container ls lists each running container, including its ID and name.
docker container ls -a lists all of your containers, including ones that aren’t running.
Liferay log messages and log files are available to view live and to copy to your host.
docker logs commands¶
docker logs command prints container log messages.
Outputs all of the current log messages
Streams new log messages, like
Appends a time stamp to each log message
Stopping a Container¶
Here are two ways to stop the container.
Allows Liferay, Tomcat, and other apps to free resources. The container entry point runs any post-shutdown scripts.
Fastest method to stop the container.
Liferay, Tomcat, and the container entry point stop immediately, without freeing resources. The entry point’s post-shutdown phase is skipped. Don’t use this method in production environments
Restarting a Container¶
The containers can be restarted like all Docker containers.
docker start [container]
docker container ls -a to look up your container’s name or ID.
Now you know the basics of starting, stopping, and monitoring a Liferay container.
If you want to know what the container entry point does and learn the container’s API, see the Container Lifecycle and API. If you want to start using the containers, exercise one of the following use cases: