Running Containers
Tasks
- Ensure that registry.access.redhat.com container registry is used.
- Download nginx image to the local computer.
- Start the nginx container.
Solution
1. Use the container registry
Red Hat container images are typically available on the Red Hat container registry (registry.access.redhat.com
). Ensure your Docker configuration is set to use this registry for pulling Red Hat certified images.
To do this, you can authenticate first to the Red Hat Container Registry. Run the following command and enter your Red Hat account username and password when prompted:
docker login registry.access.redhat.com
2. Download nginx image
Assuming you have Docker installed on your local computer, pull the Nginx image from Red Hat registry:**
docker pull registry.access.redhat.com/rhscl/nginx-116-rhel7
Verify that the Nginx image is downloaded:
docker images
3. Start the nginx container
Start a Nginx container based on the downloaded image:
docker run -d --name my-nginx -p 80:80 registry.access.redhat.com/rhscl/nginx-116-rhel7
Check the status of running containers:
docker ps
Open a web browser and navigate to http://localhost
. You should see the default Nginx welcome page, indicating that the container is running successfully.