Complete the command to expose port 80 of the container to port 8080 on the host.
docker run -p [1]:80 nginx
The -p option maps a host port to a container port. Here, port 8080 on the host is mapped to port 80 inside the container.
Complete the command to expose port 5432 of the container to the same port on the host.
docker run -p [1]:5432 postgres
Mapping port 5432 on the host to port 5432 in the container allows direct access to the database service.
Fix the error in the command to expose port 5000 of the container to port 5000 on the host.
docker run -p 5000:[1] myapp
The container port must match the port your app listens on, here 5000.
Fill both blanks to expose port 3000 of the container to port 4000 on the host and run the container in detached mode.
docker run [1] -p [2]:3000 myapp
-d runs the container detached (in background). The port mapping 4000:3000 exposes container port 3000 on host port 4000.
Fill all three blanks to expose port 22 of the container to port 2222 on the host, name the container 'ssh-server', and run it in detached mode.
docker run [1] --name [2] -p [3]:22 sshd
-d runs the container detached, --name ssh-server names the container, and -p 2222:22 maps host port 2222 to container port 22.