Complete the command to start a Docker container in detached mode.
docker run -d [1] nginxThe -p 80:80 option maps port 80 of the container to port 80 on the host, allowing web traffic. This is important when starting a web server container like nginx.
Complete the command to list all Docker containers, including stopped ones.
docker ps [1]The -a option shows all containers, including those that are stopped. Without it, only running containers are listed.
Fix the error in the command to remove a stopped container named 'webapp'.
docker [1] webappThe rm command removes a container. You must stop it first if it is running. Here, the container is stopped, so docker rm webapp deletes it.
Fill both blanks to create a Dockerfile line that copies files and sets the working directory.
COPY [1] /app/ WORKDIR [2]
The COPY . /app/ copies all files from the current folder to /app in the container. Then WORKDIR /app sets the working directory inside the container to /app.
Fill all three blanks to write a Docker command that builds an image named 'myapp' from the current directory.
docker build [1] -t [2] [3]
The -f Dockerfile option specifies the Dockerfile to use. The -t myapp tags the image with the name 'myapp'. The . tells Docker to use the current directory as the build context.