Set up core tooling for container work
Explore how you can set up core tooling to perform your container tasks.
Abstract
Preface Copy linkLink copied to clipboard!
As a developer, you can set up core tooling to start creating your containerized applications. The options are available to do the following:
- Create a default or custom Podman machine to control resources, such as CPU, memory, and disk, and set rootful or rootless connections.
-
Add custom certificates from a local Certificate Authority (CA) or third-party vendor directly to the Podman machine via Secure SHell (SSH) and the
update-ca-trustcommand. This certificate installation process is crucial for enabling secure communication and authenticating images with internal or private container registries.
Chapter 1. Customize the Podman execution environment Copy linkLink copied to clipboard!
Several configuration options are available to customize the Podman execution environment to meet your workload requirements. Find a complete list of configuration options available when creating a Podman machine below:
1.1. Required configuration options Copy linkLink copied to clipboard!
| Option | Description |
|---|---|
| Name |
Enter a name for the Podman machine, such as |
| CPU(s) | Select the number of CPUs to allocate to the machine. |
| Memory | Select the memory size to allocate to the machine. |
| Disk size | Select the disk size to allocate to the machine. |
1.2. Optional configuration options Copy linkLink copied to clipboard!
| Option | Description |
|---|---|
| Image Path |
Select an image from your local machine, such as |
| Image URL or image reference |
Enter an image URL or a registry path. You can use an image URL from the Podman releases page or use a valid registry path in the format |
| Option | Description |
|---|---|
| Machine with root privileges | Enable to use the rootful connection by default. |
1.3. Windows-specific options Copy linkLink copied to clipboard!
| Option | Description |
|---|---|
| User mode networking (traffic relayed by a user process) | Enable to route the traffic through the network connection from your Windows session. This setting is required to access resources behind your VPN connection. |
| Provider Type |
The setting is visible only to administrators, and its default value is |
1.4. macOS-specific options Copy linkLink copied to clipboard!
| Platform | Default Provider | Alternative Provider |
|---|---|---|
| macOS ARM64 |
|
|
| macOS AMD64 |
|
|
Chapter 2. Configure a Podman machine Copy linkLink copied to clipboard!
While a default Podman machine is created automatically upon installation, you can create a custom machine that allows you to manually define specific configurations:
- Allocating resources (CPUs, memory, and disk size).
- Using a custom boot image
- Setting the machine to use a rootful connection by default
- On Windows: Enabling user mode networking to route traffic through the host’s network session
Prerequisites
- You have installed Red Hat build of Podman Desktop and Podman on your machine.
For details about configuration options available for Podman machine creation, refer to the Customize the Podman execution environment section.
Procedure
- Go to the Settings > Resources page from the left navigation pane.
- In the Podman tile, click Create new. The Create a Podman machine screen opens.
Enter or customize the following details:
-
Name: Enter a descriptive name, such as
podman-machine-custom. - CPU(s): Select the number of CPUs (recommended: 2-4).
- Memory: Select memory size in GB (recommended: 4-8 GB).
- Disk size: Select disk size in GB (recommended: 20-50 GB).
-
Name: Enter a descriptive name, such as
- Optional: Provide a bootable image by using the Image Path or Image URL or image reference option.
- Customize the Machine with root privileges option to use the rootful or rootless connection.
Additional settings based on your operating system:
- On Windows: Set the value of the User mode networking and Provider Type configuration options.
- On macOS: Set the value of the Provider Type configuration option.
- Click Create.
- After the machine is successfully created, click Go back to resources.
Verification
- Check that the Podman machine is running in the Podman tile.
Chapter 3. Secure communication for containerized applications Copy linkLink copied to clipboard!
You can add certificates from your local certificate authority (CA) or from a third-party vendor into a Podman machine. After adding these certificates, you can use them in your images to:
- Secure the communication channel between the running applications in your container and the external host system.
- Validate the Secure Sockets Layer (SSL) or Transport Layer Security (TLS) certificates provided by external services for authentication.
Podman stores certificates in the machine at /etc/pki/ca-trust/source/anchors/, and you can obtain them in various formats:
-
Privacy-Enhanced Mail format (
.pem) -
Certificate file format (
.crt) -
Certificate file format (
.cer)
On Windows, the Podman commands use the CAs from the certificate store. For example, if you are unable to log in to an internal registry because the added certificate was not trusted by Podman, you can add it to the Windows certificate store. This will enable Podman commands to trust the certificate and help you log in to that registry.
3.1. Add certificates to a Podman machine Copy linkLink copied to clipboard!
You can add certificates from a local CA or third-party vendor directly to a running Podman machine. After adding a certificate, a reboot of the Podman machine is required to ensure the changes take effect.
Prerequisites
- You have a running Podman machine.
-
You have obtained the required certificates for installation, such as
certificate.pemorcertificate.crt.
Procedure
Start an interactive session with the default Podman machine:
$ podman machine ssh <machine_name>Optional: If Podman runs in the default rootless mode, switch to a root shell:
$ sudo su -Change to the directory where the certificates must be placed:
$ cd /etc/pki/ca-trust/source/anchorsPerform one of the following steps to obtain the certificate:
Use the
curlcommand to download a certificate:$ curl [-k] -o <my-certificate> https://<my-server.com/my-certificate>Use any editor, such as Notepad or Vim to create a certificate file with
.crt,.cer, or.pemextension.NoteYou can convert a certificate file to a text file and copy its content to the editor.
Add the certificate to the list of trusted certificates:
$ update-ca-trustOptional: To exit the root shell, run the following command:
$ exit-
Run the
exitcommand to exit the Podman machine. To apply your changes, reboot the Podman machine:
$ podman machine stop <machine_name> $ podman machine start <machine_name>