Skip to content

Commit

Permalink
Update READMEs
Browse files Browse the repository at this point in the history
  • Loading branch information
x86-39 committed Oct 31, 2023
1 parent 13f6952 commit d098854
Show file tree
Hide file tree
Showing 2 changed files with 585 additions and 0 deletions.
109 changes: 109 additions & 0 deletions RH-EX188/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# EX188: Red Hat Certified Specialist in Containers exam
For this I'm just going to create some containers using as many of the Containerfile keywords as possible, then run them in different ways with Podman.


# Exam Practice
To ensure I'm not sharing exam details, these are notes I took *before* the exam based on studying the exam objectives.

I passed this exam on 2023-08-07. Honestly, if you know where to find the letter "e" on your keyboard to pass env variables to a container, you're 99% of the way there.

# Exam Practice
To ensure I'm not sharing exam details, these are notes I took *before* the exam based on studying the exam objectives.
I'm using Podman Compose, even though it's not on the exam objectives, because it's easier for me than to use than Podman directly.

## Pre-requisites
On Ubuntu:
```bash
sudo apt install podman podman-compose
```

## Commands
Run a container:
```bash
podman run -d --name container-a --restart unless-stopped localhost/container-a
```

Stop a container:
```bash
podman stop container-a
```

Remove a container:
```bash
podman rm container-a
```

Run a container with a port:
```bash
podman run -d --name container-a --restart unless-stopped -p 8080:80 localhost/container-a
```

Create a volume:
```bash
podman volume create volume-a
```

Run a container with a volume:
```bash
podman run -d --name container-a --restart unless-stopped -v volume-a:/data localhost/container-a
```

Run a container with a bind mount:
```bash
podman run -d --name container-a --restart unless-stopped -v /home/user/data:/data localhost/container-a
```

Create a network:
```bash
podman network create network-a
```

Run a container with a network:
```bash
podman run -d --name container-a --restart unless-stopped --network network-a localhost/container-a
```

Run a container with an environment variable:
```bash
podman run -d --name container-a --restart unless-stopped -e VAR_A=VALUE_A localhost/container-a
```

To create an archive for a container:
```bash
podman image save --format oci-archive -o container-a.tar.gz localhost/container-a
```

Inspect the container image:
```bash
podman inspect localhost/container-a
```

Inspect a running container:
```bash
podman inspect example-a_container-a_1
```

Get the logs from a running container:
```bash
podman logs example-a_container-a_1
```

Execute a command in a running container:
```bash
podman exec -it example-a_container-a_1 /bin/bash
```

Run a compose project:
```bash
podman-compose up -d
```

Stop a compose project:
```bash
podman-compose stop
```

Bring down a compose project:
```bash
podman-compose down
```
Loading

0 comments on commit d098854

Please sign in to comment.