The ea-podman Script


Last modified: July 11, 2022

Overview

Use the /usr/local/cpanel/scripts/ea-podman script to manage your containers in EasyApache 4.

This script is included in the ea-podman package. You must install this package in order to use it.

Run the script

To run this script on the command line, use the following format:

/usr/local/cpanel/scripts/ea-podman [command] [options]
Note:
  • This script’s available options change depending on which subcommands you use. For more information, read the Options section below.
  • Your process identifiers (pid) will be public unless you set your /proc to hidepid=2. The ea-podman script will display an error message if this issue exists on your system.

Options

This script accepts the following commands, depending on the action required.

Note:
In the following tables, package represents the name of a container package.

View available container applications

To view available containers, run the following command:

/usr/local/cpanel/scripts/ea-podman [command]
Command Description Example
avail List the available EasyApache 4 container-based packages and its installation status.
Note:
This option only lists EasyApache 4 container-based packages.
avail
registered [--all] List the user’s registered containers. If the root user uses the --all flag, this commands shows all containers on the system. . registered
running Show all running containers. running

Install an EA4 container-based package

Use this command to install an application in a container from an EA4 container-based package.

/usr/local/cpanel/scripts/ea-podman install [package] [options]
Option Description Example
-e An environmental variable. install ea-tomcat100 --env MYAPPNEEEDSTHISVAR=42

When you set up a container, the system also creates the ~/ea-podman.d/container-name directory in the user’s home directory. These directories contain information, files, and other data for the container.

Install a non-cPanel-provided image

Use this command to install an application in a container from another source, such as Dockerhub.

Important:

When using non-cPanel-provided images, we strongly recommend the following precautions:

  • Only use a trusted registry.
  • Only use images that are either official or verified by the publisher.
  • Specify a version-specific tag to ensure that major or minor changes will not cause your containers to no longer function.

In the following command, application-name represents the name you want to use for your container and image represents the path to an application package.

/usr/local/cpanel/scripts/ea-podman install [application-name] [options] [image] 
Option Description Example
-e An environmental variable. ea-podman install mymongo -e "ME_CONFIG_MONGODB_ADMINUSERNAME=root" -e "ME_CONFIG_MONGODB_ADMINPASSWORD=example" docker.io/library/mongo:latest
-v A volume to mount. ea-podman install mymongo -v $HOME/myetcmongo:/etc/mongo
--cpuser-port Set a port number for inside the container.
Note:
The system will set a port for the container itself. This option sets the port used inside the container.
ea-podman install mymongo --cpuser-port=8081 docker.io/library/mongo:latest
--i-understand-the-risks-do-it-anyway Confirm that you want to install the package. ea-podman install mymongo -v $HOME:/home/user docker.io/library/mongo:latest --i-understand-the-risks-do-it-anyway

When you set up a container, the system also creates the ~/ea-podman.d/application-name directory in the user’s home directory. These directories contain information, files, and other data for the container.

Uninstall an application

To uninstall an application in a container, run the following command:

/usr/local/cpanel/scripts/ea-podman uninstall [container-name]

In the following table, container-name represents the name of the container as shown with the registered or running options.

Command Description Example
uninstall [container-name] Uninstall a container. uninstall container.cptest1.01

Manage your container applications

Remember:
When you set up a container, the system also creates the ~/ea-podman.d/container-name directory in the user’s home directory. These directories contain information, files, and other data for the container.

In the following table, container-name represents the name of the container as shown with the registered or running options and backup-file represents the name of a backup file.

Use the following commands to manage your containers:

Command Description Example
backup Backup all of the configured containers.
Note:
  • This option creates a backup file in the ea-podman-backups directory of the user’s home directory.
  • You cannot use this option to restore backups created by WHM’s Transfer Tool interface (WHM >> Home >> Transfers >> Transfer Tool) or the /usr/local/cpanel/scripts/restorepkg script.
backup
bash [container-name] [command] Open a bash shell for the named container and optionally run a command. bash example.cptest1.01 ls
remove_containers [package] Remove all containers.
Note:
This is a destructive action. We strongly recommend that you use the uninstall command instead.
remove_containers ea-tomcat100
restart [container-name] Restart the named container. restart example.cptest1.01
restore [backup-file] Restore a container from a backup file. restore ea-podman-backups/backup.20220421193100.tar.gz
start [container-name] Start a stopped container. start example.cptest1.01
status [container-name] Display the status of a container. status example.cptest1.01
stop [container-name] Stop a running container. stop example.cptest1.01
subids [--ensure] Display a list of users with their subids. subids
upgrade [container-name] Upgrade a single container. upgrade example.cptest1.01
upgrade_containers [package] [--all] Upgrade the installed containers.
Note:
You can use either the package name or the --all option, but not both.
upgrade_containers tomcat

Additional Documentation