0
0
Dockerdevops~10 mins

COPY instruction for adding files 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 line to copy a file named app.py to the container's /app directory.

Docker
COPY [1] /app/
Drag options to blanks, or click blank then click option'
Aapp/
Bapp.py
C./app.py/
D/app.py
Attempts:
3 left
💡 Hint
Common Mistakes
Adding a slash before the filename
Using a directory name instead of the file
2fill in blank
medium

Complete the Dockerfile line to copy the entire config folder into the container's /etc/config directory.

Docker
COPY [1] /etc/config/
Drag options to blanks, or click blank then click option'
Aconfig
Bconfig/
C/config
D./config
Attempts:
3 left
💡 Hint
Common Mistakes
Adding a leading slash
Adding a trailing slash unnecessarily
3fill in blank
hard

Fix the error in this Dockerfile line that tries to copy requirements.txt to /app but fails.

Docker
COPY [1] /app/
Drag options to blanks, or click blank then click option'
Arequirements.txt
B/requirements.txt
C./requirements.txt/
Drequirements
Attempts:
3 left
💡 Hint
Common Mistakes
Using a leading slash
Adding a trailing slash
Using a folder name instead of file
4fill in blank
hard

Fill both blanks to copy index.html and style.css into the container's /usr/share/nginx/html directory.

Docker
COPY [1] [2] /usr/share/nginx/html/
Drag options to blanks, or click blank then click option'
Aindex.html
Bstyle.css
Cindex.htm
Dstyles.css
Attempts:
3 left
💡 Hint
Common Mistakes
Typos in filenames
Using wrong file extensions
5fill in blank
hard

Fill all three blanks to copy app.py, requirements.txt, and Dockerfile into the container's /app directory.

Docker
COPY [1] [2] [3] /app/
Drag options to blanks, or click blank then click option'
Aapp.py
Brequirements.txt
CDockerfile
Ddockerfile
Attempts:
3 left
💡 Hint
Common Mistakes
Wrong capitalization
Using lowercase 'dockerfile' instead of 'Dockerfile'