Learn how to use the Cockpit GUI for your first container with this brief tutorial from expert Jack Wallen.
In a recent TechRepublic video, Jack Wallen shows how to deploy your first container using the Cockpit GUI that ships with Red Hat Enterprise Linux, AlmaLinux and Rocky Linux. The following is an edited transcript of his tutorial.
First, log in to Cockpit by pointing a browser to the IP address of the hosting server with port 9090 and using credentials with sudo privilege. Click Podman containers in the left navigation.
In the resulting window, click Create Container. A pop-up will appear with a randomly generated name. You can use that name or type a new name.
Next, type the image you wish to use for the container, such as nginx. You can then select which version of the image to use, such as latest.
To map the ports for the container, click Integration. In this tab, click Add Port Mapping. Type the IP address of the hosting machine, the port you wish to be visible outside of the container, followed by the internal port for nginx. Once you’ve done that, click Create and run. The container will deploy, and you should see it listed as Running.
Let’s say you’re deploying a database and want to add a volume for persistent storage. For this, you could go to the Integration tab and click Add volume. Select the host path from the dropdown, and then type the container path. For example, for MongoDB, it would be /data/db. Select an SELinux label, if applicable, and then click Create and run.
For more tutorials from Jack Wallen, subscribe to TechRepublic’s YouTube channel How To Make Tech Work — and remember to like this video.