EX188 Flashcards
See if DNS enabled on container
podman network inspect <NETWORK_NAME>
- look for "dns_enabled": false,
Create podman network linked to eth0 interface
sudo podman network create -d macvlan -o parent=eth0 webnetwork
Access another container in slirp4netns
must use full host address and mapped host port
Inspect Mounts[0].Source
podman inspect --format="{{ (index .Mounts 0).Source}}" custom-advanced
Run container, bind to localhost, set environment variable, connect to multiple networks
podman run -p 127.0.0.1:8075:80 -e NAME='Red Hat' --net postgres-net,redis-net
Stop all containers, kill after 10 seconds
podman stop --all --time=10
Connect container to a network
podman network connect example-net my-container
See port mapping of a container
podman port my-app
Podman stores the credentials in the
${XDG_RUNTIME_DIR}/containers/auth.json
Login to OpenShift repo
oc login -u admin -p admin REPO_ADDR
podman login -u $(oc whoami) -p $(oc whoami -t) REPO_ADDR
Look for nginx in repositories
podman search nginx
Build image with single layer
podman build --squash-all -t localhost/squashed-all
.
Podman repository config file
/etc/containers/registries.conf
Get information on remote docker image
skopeo inspect docker://registry.access.redhat.com/ubi9/nodejs-18
Copy image from remote repo to local file,ignore tls errors
skopeo copy --dest-tls-verify=false docker://registry.access.redhat.com/ubi9/nodejs-18 dir:/var/lib/images/nodejs-18
Containerfile: add multiple labels
LABEL name=”my-namespace/my-image-name” \
vendor=”My Company, Inc.” \
version=”1.2.3” \
Containerfile: Set env var according to argument during build
ARG VERSION=”1.16.8”
ENV VERSION=${VERSION}
Containerfile: Copy file from URL to container
ADD http://someserver.com/filename.pdf /var/www/html
Containerfile: Different container runtime commands, explain difference
ENTRYPOINT [“/usr/sbin/httpd”]
CMD [“-D”, “FOREGROUND”]