0
0
Dockerdevops~10 mins

CMD instruction for default command in Docker - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the Dockerfile to set the default command to run nginx.

Docker
CMD ["[1]"]
Drag options to blanks, or click blank then click option'
Abash
Bnode
Cnginx
Dpython
Attempts:
3 left
💡 Hint
Common Mistakes
Using shell form without brackets
Choosing a command not installed in the image
2fill in blank
medium

Complete the Dockerfile to set the default command to run python app.py using exec form.

Docker
CMD ["python", "[1]"]
Drag options to blanks, or click blank then click option'
Aapp.py
Brun.py
Cmain.py
Dserver.py
Attempts:
3 left
💡 Hint
Common Mistakes
Using shell form instead of exec form
Misspelling the Python file name
3fill in blank
hard

Fix the error in this Dockerfile line to correctly set the default command to bash.

Docker
CMD [1]
Drag options to blanks, or click blank then click option'
A[bash]
Bbash
C"bash"
D["bash"]
Attempts:
3 left
💡 Hint
Common Mistakes
Using shell form without brackets
Missing quotes around the command
4fill in blank
hard

Fill both blanks to set the default command to run node server.js in exec form.

Docker
CMD ["[1]", "[2]"]
Drag options to blanks, or click blank then click option'
Anode
Bserver.js
Capp.js
Dnpm
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the command and file name
Using npm instead of node
5fill in blank
hard

Fill all four blanks to set the default command to run python3 -m http.server 8000 in exec form.

Docker
CMD ["[1]", "[2]", "[3]", "[4]"]
Drag options to blanks, or click blank then click option'
Apython3
B-m
Chttp.server
D8000
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the http.server module argument
Using python instead of python3