IT quiz
All questions
Sign in
Sign up
JavaScript
HTML
CSS
PostgreSQL
PHP
Linux
Git
Docker
SCSS
TypeScript
SQL
Vue
DNS
Go
frontend (web)
Redis
backend
Gitlab
CI/CD
Vite
webpack
Node.js
HTTP
Python
Kotlin
Nuxt
Question #77
Author:
admin
tags:
Docker
WORKDIR
instruction value, that does not start with a slash
/
, will...
...create directory path relative to current working directory.
...create directory path relative to
/
path.
...throw an error, because violates
Dockerfile
syntax rules.
Answer
Show explanation
The
WORKDIR
instruction can be used multiple times in a
Dockerfile
.
If a relative path is provided, it will be relative to the path of the previous
WORKDIR
instruction.
For example:
WORKDIR /a WORKDIR b WORKDIR c RUN pwd
The output of the final
pwd
command in this
Dockerfile
would be
/a/b/c
.
Rate the difficulty of the question:
1
2
3
4
5
6
7
8
9
10
easy
hard
←
Previous question
Next question
→
Write new comment