These Docker commands build an image named "act-selenium", list all your local Docker images, and display information about all your Docker containers, both running and stopped.
npm run import -- "use Docker"
docker build -t act-selenium
docker images
docker ps -a
#!/bin/bash
# Define a function to build and tag the Docker image
build_and_tag() {
docker build -t $1
}
# Define a function to list all available Docker images
list_images() {
docker images
}
# Define a function to list all running and stopped Docker containers
list_containers() {
docker ps -a
}
# Build and tag the Docker image with the name "act-selenium"
build_and_tag "act-selenium"
# List all available Docker images
echo "Available Docker Images:"
list_images
# List all running and stopped Docker containers
echo "Running and Stopped Docker Containers:"
list_containers
Here's a breakdown of those Docker commands:
docker build -t act-selenium
-t act-selenium
: This tag names the image "act-selenium". Think of a tag like a label for your image.Dockerfile
in the current directory to tell Docker how to build the image. This file contains instructions like which base image to use, what software to install, and how to configure the environment.docker images
docker ps -a
-a
: This flag tells Docker to show all containers, not just the currently running ones.In summary:
Dockerfile
.