podman pull imagename
podman run imagename
Example:
podman pull hello-world
podman run hello-world
podman container ls
podman container ls -a
podman image ls
# Use an official Ubuntu base image
FROM ubuntu:latest
# Install nginx
RUN apt-get update && apt-get install -y nginx
# Expose port 80
EXPOSE 80
# Run nginx
CMD ["nginx", "-g", "daemon off;"]
Build an image
podman build -t gc-nginx-image .
Run the container using above image
podman run --name my-web-app -d -p 8080:80 gc-nginx-image
Open browser and navigate to http://localhost:8080
Python Example
main.py
def add(x, y):
return x + y
def subtract(x, y):
return x - y
def multiply(x, y):
return x * y
def divide(x, y):
if y == 0:
return "Error! Division by zero."
return x / y
if __name__ == "__main__":
print(add(1, 2))
print(subtract(1, 2))
print(multiply(1, 2))
print(divide(1, 2))