Complete the code to build a Docker image named 'myapp' using the Dockerfile in the current directory.
docker build -t myapp [1] Dockerfile .-d which is for detached mode in other commands.-p which is for port mapping.-b which is not a valid Docker build option.The -f option specifies the Dockerfile to use. Here, it points to the current directory's Dockerfile.
Complete the command to push the Docker image 'myapp' to the Docker Hub repository 'username/myapp'.
docker [1] username/myapppull which downloads images.run which starts containers.build which creates images locally.The docker push command uploads your image to a remote repository like Docker Hub.
Fix the error in the GitHub Actions step to build a Docker image with tag 'latest'.
- name: Build Docker image
run: docker build -t myapp[1] .- instead of colon./ which is for repository names.Docker image tags use a colon : before the tag name, like :latest.
Fill both blanks to create a dictionary comprehension that maps branch names to their Docker image tags, only for branches starting with 'release'.
images = {branch: branch[1] 'v1' for branch in branches if branch.[2]('release')}== instead of startswith for string prefix check.in which checks substring anywhere.- or other operators instead of + for string join.The + operator joins strings. The startswith method checks if a string begins with another string.
Fill all three blanks to create a dictionary comprehension that maps service names (uppercase) to their version numbers, only if version is greater than 0.
service_versions = { [1]: [2] for [3], version in services.items() if [2] > 0}service instead of name as loop variable.name.upper() converts the service name to uppercase for the key. version is the value. name and version come from iterating services.items().